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
d51102a1
Commit
d51102a1
authored
Apr 28, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example.cpp fix
parent
f2023e80
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
bench.cpp
example/bench.cpp
+5
-5
example.cpp
example/example.cpp
+1
-1
No files found.
example/bench.cpp
View file @
d51102a1
...
...
@@ -33,7 +33,7 @@ int main(int argc, char *argv[])
int
queue_size
=
1048576
;
int
howmany
=
1000000
;
int
threads
=
1
0
;
int
threads
=
1
;
int
file_size
=
30
*
1024
*
1024
;
int
rotating_files
=
5
;
...
...
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
threads
=
atoi
(
argv
[
2
]);
if
(
argc
>
3
)
queue_size
=
atoi
(
argv
[
3
]);
/*
cout << "*******************************************************************************\n";
cout << "Single thread, " << format(howmany) << " iterations" << endl;
cout << "*******************************************************************************\n";
...
...
@@ -67,15 +67,15 @@ int main(int argc, char *argv[])
auto daily_mt = spdlog::daily_logger_mt("daily_mt", "logs/daily_mt.log");
bench_mt(howmany, daily_mt, threads);
bench(howmany, spdlog::create<null_sink_st>("null_mt"));
*/
cout
<<
"
\n
*******************************************************************************
\n
"
;
cout
<<
"async logging.. "
<<
threads
<<
" threads sharing same logger, "
<<
format
(
howmany
)
<<
" iterations "
<<
endl
;
cout
<<
"*******************************************************************************
\n
"
;
for
(
int
i
=
0
;
i
<
3
;
++
i
)
for
(
int
i
=
0
;
i
<
3
00
;
++
i
)
{
spdlog
::
init_thread_pool
(
queue_size
,
1
);
auto
as
=
spdlog
::
daily_logger_mt
<
spdlog
::
create_async
>
(
"as"
,
"logs/daily_async.log"
);
auto
as
=
spdlog
::
basic_logger_mt
<
spdlog
::
create_async
>
(
"as"
,
"logs/basic_async.log"
,
true
);
bench_mt
(
howmany
,
as
,
threads
);
spdlog
::
drop
(
"as"
);
}
...
...
example/example.cpp
View file @
d51102a1
...
...
@@ -59,7 +59,7 @@ int main(int, char *[])
daily_logger
->
info
(
123.44
);
// Customize msg format for all messages
// spd::set_pattern("[%^+++%$] [%H:%M:%S %z] [thread %t] %v"); //crash
spd
::
set_pattern
(
"[%^+++%$] [%H:%M:%S %z] [thread %t] %v"
);
console
->
info
(
"This an info message with custom format"
);
console
->
error
(
"This an error message with custom format"
);
...
...
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