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
d6cc5847
Commit
d6cc5847
authored
Aug 13, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Udpated README
parent
1d672d39
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
README.md
README.md
+21
-14
No files found.
README.md
View file @
d6cc5847
...
...
@@ -166,20 +166,7 @@ spdlog::flush_every(std::chrono::seconds(3));
```
---
#### Asynchronous logging
```
c++
#include "spdlog/async.h"
void
async_example
()
{
// default thread pool settings can be modified *before* creating the async logger:
// spdlog::init_thread_pool(8192, 1); // queue with 8k items and 1 backing thread.
auto
async_file
=
spdlog
::
basic_logger_mt
<
spdlog
::
async_factory
>
(
"async_file_logger"
,
"logs/async_log.txt"
);
// alternatively:
// auto async_file = spdlog::create_async<spdlog::sinks::basic_file_sink_mt>("async_file_logger", "logs/async_log.txt");
}
```
---
#### Logger with multi sinks - each with different format and log level
```
c++
...
...
@@ -203,9 +190,29 @@ void multi_sink_example()
```
---
#### Async logger with multi sinks
#### Asynchronous logging
```
c++
#include "spdlog/async.h"
#include "spdlog/sinks/basic_file_sink.h"
void
async_example
()
{
// default thread pool settings can be modified *before* creating the async logger:
// spdlog::init_thread_pool(8192, 1); // queue with 8k items and 1 backing thread.
auto
async_file
=
spdlog
::
basic_logger_mt
<
spdlog
::
async_factory
>
(
"async_file_logger"
,
"logs/async_log.txt"
);
// alternatively:
// auto async_file = spdlog::create_async<spdlog::sinks::basic_file_sink_mt>("async_file_logger", "logs/async_log.txt");
}
```
---
#### Asynchronous logger with multi sinks
```
c++
// create asynchronous logger with 2 sinks.
#include "spdlog/sinks/stdout_color_sinks.h"
#include "spdlog/sinks/rotating_file_sink.h"
void
multi_sink_example2
()
{
spdlog
::
init_thread_pool
(
8192
,
1
);
...
...
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