Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
74e2aa9c
Commit
74e2aa9c
authored
Jun 19, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Micoro optimize macros
parent
b9cc158e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
logger.h
include/spdlog/logger.h
+10
-6
spdlog.h
include/spdlog/spdlog.h
+3
-2
No files found.
include/spdlog/logger.h
View file @
74e2aa9c
...
...
@@ -63,13 +63,8 @@ public:
void
swap
(
spdlog
::
logger
&
other
);
template
<
typename
...
Args
>
void
log
(
source_loc
loc
,
level
::
level_enum
lvl
,
const
char
*
fmt
,
const
Args
&
...
args
)
void
force_
log
(
source_loc
loc
,
level
::
level_enum
lvl
,
const
char
*
fmt
,
const
Args
&
...
args
)
{
if
(
!
should_log
(
lvl
))
{
return
;
}
try
{
fmt
::
memory_buffer
buf
;
...
...
@@ -87,6 +82,15 @@ public:
}
}
template
<
typename
...
Args
>
void
log
(
source_loc
loc
,
level
::
level_enum
lvl
,
const
char
*
fmt
,
const
Args
&
...
args
)
{
if
(
should_log
(
lvl
))
{
force_log
(
loc
,
lvl
,
fmt
,
args
...);
}
}
template
<
typename
...
Args
>
void
log
(
level
::
level_enum
lvl
,
const
char
*
fmt
,
const
Args
&
...
args
)
{
...
...
include/spdlog/spdlog.h
View file @
74e2aa9c
...
...
@@ -27,8 +27,9 @@ using default_factory = synchronous_factory;
// Create and register a logger with a templated sink type
// The logger's level, formatter and flush level will be set according the
// global settings.
//
// Example:
// spdlog::create<daily_file_sink_st>("logger_name", "dailylog_filename", 11, 59);
//
spdlog::create<daily_file_sink_st>("logger_name", "dailylog_filename", 11, 59);
template
<
typename
Sink
,
typename
...
SinkArgs
>
inline
std
::
shared_ptr
<
spdlog
::
logger
>
create
(
std
::
string
logger_name
,
SinkArgs
&&
...
sink_args
)
{
...
...
@@ -267,7 +268,7 @@ inline void critical(const wchar_t *fmt, const Args &... args)
do \
{ \
if (logger->should_log(level)) \
logger->log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__); \
logger->
force_
log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__); \
} while (0)
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
...
...
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