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
b9e8fd20
Commit
b9e8fd20
authored
Mar 29, 2017
by
Gabi Melman
Committed by
GitHub
Mar 29, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #407 from eliaskosunen/master
Update example in README.md
parents
51b3cc0a
a3e84cb3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
README.md
README.md
+4
-4
No files found.
README.md
View file @
b9e8fd20
...
...
@@ -149,13 +149,13 @@ int main(int, char*[])
err_handler_example
();
// Apply a function on all registered loggers
spd
::
apply_all
([
&
](
std
::
shared_ptr
<
spd
log
::
logger
>
l
)
spd
::
apply_all
([
&
](
std
::
shared_ptr
<
spd
::
logger
>
l
)
{
l
->
info
(
"End of example."
);
});
// Release and close all loggers
spd
log
::
drop_all
();
spd
::
drop_all
();
}
// Exceptions will only be thrown upon failed logger or sink construction (not during logging)
catch
(
const
spd
::
spdlog_ex
&
ex
)
...
...
@@ -168,7 +168,7 @@ int main(int, char*[])
void
async_example
()
{
size_t
q_size
=
4096
;
//queue size must be power of 2
spd
log
::
set_async_mode
(
q_size
);
spd
::
set_async_mode
(
q_size
);
auto
async_file
=
spd
::
daily_logger_st
(
"async_file_logger"
,
"logs/async_log.txt"
);
for
(
int
i
=
0
;
i
<
100
;
++
i
)
async_file
->
info
(
"Async message #{}"
,
i
);
...
...
@@ -206,7 +206,7 @@ void user_defined_example()
//
void
err_handler_example
()
{
spd
log
::
set_error_handler
([](
const
std
::
string
&
msg
)
{
spd
::
set_error_handler
([](
const
std
::
string
&
msg
)
{
std
::
cerr
<<
"my err handler: "
<<
msg
<<
std
::
endl
;
});
// (or logger->set_error_handler(..) to set for specific logger)
...
...
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