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
69f3d267
Commit
69f3d267
authored
Mar 06, 2020
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated readme.
parent
8038bc2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
README.md
README.md
+18
-2
No files found.
README.md
View file @
69f3d267
...
...
@@ -36,7 +36,7 @@ $ cmake .. && make -j
## Features
*
Very fast (see
[
benchmarks
](
#benchmarks
)
below).
*
Headers only
, just copy and use. Or use as a compiled library.
*
Headers only
or compiled version
*
Feature rich formatting, using the excellent
[
fmt
](
https://github.com/fmtlib/fmt
)
library.
*
**New!**
[
Backtrace
](
#backtrace-support
)
support - store debug messages in a ring buffer and display later on demand.
*
Asynchronous mode (optional)
...
...
@@ -49,7 +49,8 @@ $ cmake .. && make -j
*
syslog.
*
Windows debugger (
```OutputDebugString(..)```
)
*
Easily extendable with custom log targets (just implement a single function in the
[
sink
](
include/spdlog/sinks/sink.h
)
interface).
*
Severity based filtering - threshold levels can be modified in runtime as well as in compile time.
*
Log filtering - log levels can be modified in runtime as well as in compile time.
*
Support for loading log levels can be argv or env vars
## Usage samples
...
...
@@ -85,6 +86,21 @@ int main()
auto
file_logger
=
spdlog
::
basic_logger_mt
(
"basic_logger"
,
"logs/basic.txt"
);
spdlog
::
set_default_logger
(
file_logger
);
}
```
#### load log levels from env variable
```
c++
#include "spdlog/cfg/env.h"
void
load_levels_example
()
{
// Set the log level to "info" and mylogger to to "trace":
// SPDLOG_LEVEL=info,mylogger=trace && ./example
spdlog
::
cfg
::
load_env_levels
();
// or from command line:
// ./example SPDLOG_LEVEL=info,mylogger=trace
// #include "spdlog/cfg/argv.h" // for loading levels from argv
// spdlog::cfg::load_argv_levels(args, argv);
}
```
#### create stdout/stderr logger object
```
c++
...
...
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