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
b89023ef
Commit
b89023ef
authored
Aug 26, 2019
by
gabime
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'backtrace_support' of
https://github.com/gabime/spdlog
into backtrace_support
parents
b1553475
15faf742
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
README.md
README.md
+9
-6
No files found.
README.md
View file @
b89023ef
...
...
@@ -37,6 +37,7 @@ Very fast, header-only/compiled, C++ logging library. [![Build Status](https://t
*
Very fast (see
[
benchmarks
](
#benchmarks
)
below).
*
Headers only, just copy and use. Or use as a compiled library.
*
Feature rich formatting, using the excellent
[
fmt
](
https://github.com/fmtlib/fmt
)
library.
*
[
Backtrace
](
#backtrace-support
)
support - store debugging messages in a ring buffer for later inspection.
*
Fast asynchronous mode (optional)
*
[
Custom
](
https://github.com/gabime/spdlog/wiki/3.-Custom-formatting
)
formatting.
*
Multi/Single threaded loggers.
...
...
@@ -137,15 +138,17 @@ void daily_example()
```
---
####
Cloning loggers
####
Backtrace support
```
c++
// clone a logger and give it new name.
// Useful for creating subsystem loggers from some "root" logger
void
clone_example
()
// Loggers can store in a ring buffer all messages (including debug/trace) for later inspection.
// When needed, call dump_backtrace() to see what happened:
spdlog
::
enable_backtrace
(
32
);
// create ring buffer with capacity of 32 messages
for
(
int
i
=
0
;
i
<
100
;
i
++
)
{
auto
network_logger
=
spdlog
::
get
(
"root"
)
->
clone
(
"network"
);
network_logger
->
info
(
"Logging network stuff.."
);
spdlog
::
debug
(
"Backtrace message {}"
,
i
);
// not logged yet..
}
// e.g. if some error happened:
spdlog
::
dump_backtrace
();
// log them now!
```
---
...
...
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