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
ef6eb376
Commit
ef6eb376
authored
May 18, 2017
by
Alexander Zilberkant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable message counter feature in tweakme.h
parent
f29ff77a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
logger_impl.h
include/spdlog/details/logger_impl.h
+10
-0
pattern_formatter_impl.h
include/spdlog/details/pattern_formatter_impl.h
+2
-0
tweakme.h
include/spdlog/tweakme.h
+7
-0
No files found.
include/spdlog/details/logger_impl.h
View file @
ef6eb376
...
...
@@ -65,7 +65,11 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* fmt, const Ar
{
details
::
log_msg
log_msg
(
&
_name
,
lvl
);
log_msg
.
raw
.
write
(
fmt
,
args
...);
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
log_msg
.
msg_id
=
_msg_counter
.
fetch_add
(
1
,
std
::
memory_order_relaxed
);
#endif
_sink_it
(
log_msg
);
}
catch
(
const
std
::
exception
&
ex
)
...
...
@@ -86,7 +90,11 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* msg)
{
details
::
log_msg
log_msg
(
&
_name
,
lvl
);
log_msg
.
raw
<<
msg
;
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
log_msg
.
msg_id
=
_msg_counter
.
fetch_add
(
1
,
std
::
memory_order_relaxed
);
#endif
_sink_it
(
log_msg
);
}
catch
(
const
std
::
exception
&
ex
)
...
...
@@ -108,7 +116,9 @@ inline void spdlog::logger::log(level::level_enum lvl, const T& msg)
{
details
::
log_msg
log_msg
(
&
_name
,
lvl
);
log_msg
.
raw
<<
msg
;
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
log_msg
.
msg_id
=
_msg_counter
.
fetch_add
(
1
,
std
::
memory_order_relaxed
);
#endif
_sink_it
(
log_msg
);
}
catch
(
const
std
::
exception
&
ex
)
...
...
include/spdlog/details/pattern_formatter_impl.h
View file @
ef6eb376
...
...
@@ -652,9 +652,11 @@ inline void spdlog::pattern_formatter::handle_flag(char flag)
_formatters
.
push_back
(
std
::
unique_ptr
<
details
::
flag_formatter
>
(
new
details
::
pid_formatter
()));
break
;
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
case
(
'i'
):
_formatters
.
push_back
(
std
::
unique_ptr
<
details
::
flag_formatter
>
(
new
details
::
i_formatter
()));
break
;
#endif
default
:
//Unknown flag appears as is
_formatters
.
push_back
(
std
::
unique_ptr
<
details
::
flag_formatter
>
(
new
details
::
ch_formatter
(
'%'
)));
...
...
include/spdlog/tweakme.h
View file @
ef6eb376
...
...
@@ -120,3 +120,10 @@
//
// #define SPDLOG_FINAL final
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Uncomment to enable message counting feature. Adds %i logger pattern that
// prints log message sequence id.
//
// #define SPDLOG_ENABLE_MESSAGE_COUNTER
///////////////////////////////////////////////////////////////////////////////
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