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
3da189f7
Commit
3da189f7
authored
Dec 06, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPDLOG_TRACE to check log level before calling the logger
parent
058d2d1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
include/spdlog/common.h
include/spdlog/common.h
+2
-2
include/spdlog/spdlog.h
include/spdlog/spdlog.h
+3
-1
No files found.
include/spdlog/common.h
View file @
3da189f7
...
@@ -60,9 +60,9 @@
...
@@ -60,9 +60,9 @@
#endif //__builtin_strrchr not defined
#endif //__builtin_strrchr not defined
#ifdef _WIN32
#ifdef _WIN32
#define SPDLOG_FILE_BASENAME
SPDLOG_STRRCHR("\\" __FILE__
, '\\') + 1
#define SPDLOG_FILE_BASENAME
(file) SPDLOG_STRRCHR("\\" file
, '\\') + 1
#else
#else
#define SPDLOG_FILE_BASENAME
SPDLOG_STRRCHR("/" __FILE__
, '/') + 1
#define SPDLOG_FILE_BASENAME
(file) SPDLOG_STRRCHR("/" file
, '/') + 1
#endif
#endif
namespace
spdlog
{
namespace
spdlog
{
...
...
include/spdlog/spdlog.h
View file @
3da189f7
...
@@ -314,7 +314,9 @@ inline void critical(const wchar_t *fmt, const Args &... args)
...
@@ -314,7 +314,9 @@ inline void critical(const wchar_t *fmt, const Args &... args)
//
//
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
#define SPDLOG_LOGGER_TRACE(logger, ...) logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME, __LINE__}, spdlog::level::trace, __VA_ARGS__)
#define SPDLOG_LOGGER_TRACE(logger, ...)\
if(logger->should_log(spdlog::level::trace))\
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__}, spdlog::level::trace, __VA_ARGS__)
#define SPDLOG_TRACE(...) SPDLOG_LOGGER_TRACE(spdlog::default_logger_raw(), __VA_ARGS__)
#define SPDLOG_TRACE(...) SPDLOG_LOGGER_TRACE(spdlog::default_logger_raw(), __VA_ARGS__)
#else
#else
#define SPDLOG_LOGGER_TRACE(logger, ...) (void)0
#define SPDLOG_LOGGER_TRACE(logger, ...) (void)0
...
...
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