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
99abcf6d
Unverified
Commit
99abcf6d
authored
Jul 24, 2020
by
Gabi Melman
Committed by
GitHub
Jul 24, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1628 from eyalroz/issue-1627
Fix for issue #1627: Global get_level() and should_log()
parents
ae02fba1
70097275
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
include/spdlog/spdlog-inl.h
include/spdlog/spdlog-inl.h
+11
-1
include/spdlog/spdlog.h
include/spdlog/spdlog.h
+6
-0
No files found.
include/spdlog/spdlog-inl.h
View file @
99abcf6d
...
...
@@ -47,6 +47,16 @@ SPDLOG_INLINE void dump_backtrace()
default_logger_raw
()
->
dump_backtrace
();
}
SPDLOG_API
level
::
level_enum
get_level
()
{
return
default_logger_raw
()
->
level
();
}
SPDLOG_INLINE
bool
should_log
(
level
::
level_enum
log_level
)
{
return
default_logger_raw
()
->
should_log
(
log_level
);
}
SPDLOG_INLINE
void
set_level
(
level
::
level_enum
log_level
)
{
details
::
registry
::
instance
().
set_level
(
log_level
);
...
...
@@ -112,4 +122,4 @@ SPDLOG_INLINE void set_default_logger(std::shared_ptr<spdlog::logger> default_lo
details
::
registry
::
instance
().
set_default_logger
(
std
::
move
(
default_logger
));
}
}
// namespace spdlog
\ No newline at end of file
}
// namespace spdlog
include/spdlog/spdlog.h
View file @
99abcf6d
...
...
@@ -67,9 +67,15 @@ SPDLOG_API void disable_backtrace();
// call dump backtrace on default logger
SPDLOG_API
void
dump_backtrace
();
// Get global logging level
SPDLOG_API
level
::
level_enum
get_level
();
// Set global logging level
SPDLOG_API
void
set_level
(
level
::
level_enum
log_level
);
// Determine whether the default logger should log messages with a certain level
SPDLOG_API
bool
should_log
(
level
::
level_enum
lvl
);
// Set global flush level
SPDLOG_API
void
flush_on
(
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