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
c6d558b6
Unverified
Commit
c6d558b6
authored
Aug 27, 2019
by
Gabi Melman
Committed by
GitHub
Aug 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
755ce0a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
README.md
README.md
+8
-6
No files found.
README.md
View file @
c6d558b6
...
@@ -137,15 +137,17 @@ void daily_example()
...
@@ -137,15 +137,17 @@ void daily_example()
```
```
---
---
####
Cloning loggers
####
Backtrace support
```
c++
```
c++
// clone a logger and give it new name.
// Loggers can store in a ring buffer all messages (including debug/trace) for later inspection.
// Useful for creating subsystem loggers from some "root" logger
// When needed, call dump_backtrace() to see what happened:
void
clone_example
()
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"
);
spdlog
::
debug
(
"Backtrace message {}"
,
i
);
// not logged yet..
network_logger
->
info
(
"Logging network stuff.."
);
}
}
// 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