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
bf408558
Commit
bf408558
authored
Nov 03, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Micro-optimize level checking by inlining
parent
3ee4f281
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
include/spdlog/logger-inl.h
include/spdlog/logger-inl.h
+0
-10
include/spdlog/logger.h
include/spdlog/logger.h
+8
-2
No files found.
include/spdlog/logger-inl.h
View file @
bf408558
...
@@ -64,16 +64,6 @@ SPDLOG_INLINE void swap(logger &a, logger &b)
...
@@ -64,16 +64,6 @@ SPDLOG_INLINE void swap(logger &a, logger &b)
a
.
swap
(
b
);
a
.
swap
(
b
);
}
}
SPDLOG_INLINE
bool
logger
::
should_log
(
level
::
level_enum
msg_level
)
const
{
return
msg_level
>=
level_
.
load
(
std
::
memory_order_relaxed
);
}
SPDLOG_INLINE
bool
logger
::
should_backtrace
()
const
{
return
tracer_
.
enabled
();
}
SPDLOG_INLINE
void
logger
::
set_level
(
level
::
level_enum
log_level
)
SPDLOG_INLINE
void
logger
::
set_level
(
level
::
level_enum
log_level
)
{
{
level_
.
store
(
log_level
);
level_
.
store
(
log_level
);
...
...
include/spdlog/logger.h
View file @
bf408558
...
@@ -299,10 +299,16 @@ public:
...
@@ -299,10 +299,16 @@ public:
#endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT
#endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT
// return true logging is enabled for the given level.
// return true logging is enabled for the given level.
bool
should_log
(
level
::
level_enum
msg_level
)
const
;
bool
should_log
(
level
::
level_enum
msg_level
)
const
{
return
msg_level
>=
level_
.
load
(
std
::
memory_order_relaxed
);
}
// return true if backtrace logging is enabled.
// return true if backtrace logging is enabled.
bool
should_backtrace
()
const
;
bool
should_backtrace
()
const
{
return
tracer_
.
enabled
();
}
void
set_level
(
level
::
level_enum
log_level
);
void
set_level
(
level
::
level_enum
log_level
);
...
...
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