Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
5355bd3a
Commit
5355bd3a
authored
Feb 25, 2018
by
Daniel Chabrowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
readability-named-parameter
parent
35a843f8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
29 deletions
+23
-29
include/spdlog/details/async_log_helper.h
include/spdlog/details/async_log_helper.h
+1
-1
include/spdlog/logger.h
include/spdlog/logger.h
+20
-20
include/spdlog/spdlog.h
include/spdlog/spdlog.h
+2
-2
tests/test_misc.cpp
tests/test_misc.cpp
+0
-6
No files found.
include/spdlog/details/async_log_helper.h
View file @
5355bd3a
...
...
@@ -139,7 +139,7 @@ public:
async_log_helper
(
const
async_log_helper
&
)
=
delete
;
async_log_helper
&
operator
=
(
const
async_log_helper
&
)
=
delete
;
void
set_formatter
(
formatter_ptr
);
void
set_formatter
(
formatter_ptr
msg_formatter
);
void
flush
(
bool
wait_for_q
);
...
...
include/spdlog/logger.h
View file @
5355bd3a
...
...
@@ -26,8 +26,9 @@ class logger
{
public:
logger
(
const
std
::
string
&
name
,
sink_ptr
single_sink
);
logger
(
const
std
::
string
&
name
,
sinks_init_list
);
template
<
class
It
>
logger
(
const
std
::
string
&
name
,
sinks_init_list
sinks
);
template
<
class
It
>
logger
(
std
::
string
name
,
const
It
&
begin
,
const
It
&
end
);
virtual
~
logger
();
...
...
@@ -44,7 +45,6 @@ public:
template
<
typename
Arg1
,
typename
...
Args
>
void
error
(
const
char
*
fmt
,
const
Arg1
&
,
const
Args
&
...
args
);
template
<
typename
Arg1
,
typename
...
Args
>
void
critical
(
const
char
*
fmt
,
const
Arg1
&
,
const
Args
&
...
args
);
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
template
<
typename
...
Args
>
void
log
(
level
::
level_enum
lvl
,
const
wchar_t
*
msg
);
template
<
typename
...
Args
>
void
log
(
level
::
level_enum
lvl
,
const
wchar_t
*
fmt
,
const
Args
&
...
args
);
...
...
@@ -57,19 +57,19 @@ public:
#endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT
template
<
typename
T
>
void
log
(
level
::
level_enum
lvl
,
const
T
&
);
template
<
typename
T
>
void
trace
(
const
T
&
);
template
<
typename
T
>
void
debug
(
const
T
&
);
template
<
typename
T
>
void
info
(
const
T
&
);
template
<
typename
T
>
void
warn
(
const
T
&
);
template
<
typename
T
>
void
error
(
const
T
&
);
template
<
typename
T
>
void
critical
(
const
T
&
);
bool
should_log
(
level
::
level_enum
)
const
;
void
set_level
(
level
::
level_enum
);
template
<
typename
T
>
void
trace
(
const
T
&
msg
);
template
<
typename
T
>
void
debug
(
const
T
&
msg
);
template
<
typename
T
>
void
info
(
const
T
&
msg
);
template
<
typename
T
>
void
warn
(
const
T
&
msg
);
template
<
typename
T
>
void
error
(
const
T
&
msg
);
template
<
typename
T
>
void
critical
(
const
T
&
msg
);
bool
should_log
(
level
::
level_enum
msg_level
)
const
;
void
set_level
(
level
::
level_enum
log_level
);
level
::
level_enum
level
()
const
;
const
std
::
string
&
name
()
const
;
void
set_pattern
(
const
std
::
string
&
,
pattern_time_typ
e
=
pattern_time_type
::
local
);
void
set_formatter
(
formatter_ptr
);
void
set_pattern
(
const
std
::
string
&
pattern
,
pattern_time_type
pattern_tim
e
=
pattern_time_type
::
local
);
void
set_formatter
(
formatter_ptr
msg_formatter
);
// automatically call flush() if message level >= log_level
void
flush_on
(
level
::
level_enum
log_level
);
...
...
@@ -79,22 +79,22 @@ public:
const
std
::
vector
<
sink_ptr
>&
sinks
()
const
;
// error handler
virtual
void
set_error_handler
(
log_err_handler
);
virtual
void
set_error_handler
(
log_err_handler
err_handler
);
virtual
log_err_handler
error_handler
();
protected:
virtual
void
_sink_it
(
details
::
log_msg
&
);
virtual
void
_set_pattern
(
const
std
::
string
&
,
pattern_time_typ
e
);
virtual
void
_set_formatter
(
formatter_ptr
);
virtual
void
_sink_it
(
details
::
log_msg
&
msg
);
virtual
void
_set_pattern
(
const
std
::
string
&
pattern
,
pattern_time_type
pattern_tim
e
);
virtual
void
_set_formatter
(
formatter_ptr
msg_formatter
);
// default error handler: print the error to stderr with the max rate of 1 message/minute
virtual
void
_default_err_handler
(
const
std
::
string
&
msg
);
// return true if the given message level should trigger a flush
bool
_should_flush_on
(
const
details
::
log_msg
&
);
bool
_should_flush_on
(
const
details
::
log_msg
&
msg
);
// increment the message count (only if defined(SPDLOG_ENABLE_MESSAGE_COUNTER))
void
_incr_msg_counter
(
details
::
log_msg
&
msg
);
void
_incr_msg_counter
(
details
::
log_msg
&
msg
);
const
std
::
string
_name
;
std
::
vector
<
sink_ptr
>
_sinks
;
...
...
include/spdlog/spdlog.h
View file @
5355bd3a
...
...
@@ -46,7 +46,7 @@ void flush_on(level::level_enum log_level);
//
// Set global error handler
//
void
set_error_handler
(
log_err_handler
);
void
set_error_handler
(
log_err_handler
handler
);
//
// Turn on async mode (off by default) and set the queue size for each async_logger.
...
...
@@ -129,7 +129,7 @@ std::shared_ptr<logger> create(const std::string& logger_name, const It& sinks_b
// Example:
// spdlog::create<daily_file_sink_st>("mylog", "dailylog_filename");
template
<
typename
Sink
,
typename
...
Args
>
std
::
shared_ptr
<
spdlog
::
logger
>
create
(
const
std
::
string
&
logger_name
,
Args
...);
std
::
shared_ptr
<
spdlog
::
logger
>
create
(
const
std
::
string
&
logger_name
,
Args
...
args
);
// Create and register an async logger with a single sink
std
::
shared_ptr
<
logger
>
create_async
(
const
std
::
string
&
logger_name
,
const
sink_ptr
&
sink
,
size_t
queue_size
,
const
async_overflow_policy
overflow_policy
=
async_overflow_policy
::
block_retry
,
const
std
::
function
<
void
()
>&
worker_warmup_cb
=
nullptr
,
const
std
::
chrono
::
milliseconds
&
flush_interval_ms
=
std
::
chrono
::
milliseconds
::
zero
(),
const
std
::
function
<
void
()
>&
worker_teardown_cb
=
nullptr
);
...
...
tests/test_misc.cpp
View file @
5355bd3a
#include "includes.h"
template
<
class
T
>
...
...
@@ -16,11 +15,6 @@ std::string log_info(const T& what, spdlog::level::level_enum logger_level = spd
return
oss
.
str
().
substr
(
0
,
oss
.
str
().
length
()
-
strlen
(
spdlog
::
details
::
os
::
default_eol
));
}
TEST_CASE
(
"basic_logging "
,
"[basic_logging]"
)
{
//const char
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment