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
f4d9c31a
Commit
f4d9c31a
authored
Oct 18, 2014
by
gabi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bench update
parent
b36a8034
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
23 deletions
+14
-23
bench.cpp
example/bench.cpp
+3
-5
example.cpp
example/example.cpp
+11
-18
No files found.
example/bench.cpp
View file @
f4d9c31a
...
...
@@ -8,14 +8,12 @@
#include "c11log/sinks/null_sink.h"
#include "utils.h"
using
std
::
cout
;
using
std
::
endl
;
using
namespace
std
::
chrono
;
using
namespace
c11log
;
using
namespace
utils
;
int
main
_
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
const
unsigned
int
howmany
=
argc
<=
1
?
500000
:
atoi
(
argv
[
1
]);
...
...
@@ -26,9 +24,9 @@ int main_(int argc, char* argv[])
cout_logger
.
info
()
<<
"Hello logger "
<<
1234
;
auto
nullsink
=
std
::
make_shared
<
sinks
::
null_sink_st
>
();
//auto rotating = std::make_shared<sinks::rotating_file_sink_mt>("myrotating", "txt", 1024 * 1024 * 5, 5, 100
);
auto
rotating
=
std
::
make_shared
<
sinks
::
rotating_file_sink_mt
>
(
"myrotating"
,
"txt"
,
1024
*
1024
*
5
,
5
,
1
);
logger
my_logger
(
"my_logger"
,
{
nullsink
});
logger
my_logger
(
"my_logger"
,
{
rotating
});
auto
start
=
system_clock
::
now
();
for
(
unsigned
int
i
=
1
;
i
<=
howmany
;
++
i
)
...
...
example/example.cpp
View file @
f4d9c31a
...
...
@@ -8,28 +8,21 @@
#include "c11log/sinks/stdout_sinks.h"
#include "c11log/sinks/file_sinks.h"
using
namespace
std
;
using
namespace
c11log
;
int
main
(
int
,
char
*
[])
{
auto
console
=
c11log
::
factory
::
stdout_logger
();
auto
file
=
c11log
::
factory
::
simple_file_logger
(
"log.txt"
);
auto
rotating
=
c11log
::
factory
::
rotating_file_logger
(
"myrotating"
,
"txt"
,
1024
*
1024
*
5
,
5
,
1
);
auto
daily
=
c11log
::
factory
::
daily_file_logger
(
"dailylog"
,
"txt"
,
1
,
"daily_logger"
);
//console->info() << "This is variadic ", " func, ", 123 << " YES";
FFLOG_TRACE
(
console
,
"This is "
,
1
);
details
::
fast_oss
f
(
const
std
::
string
&
what
)
{
details
::
fast_oss
oss
;
oss
<<
what
;
return
oss
;
}
int
main_
(
int
,
char
*
[])
{
file
->
info
(
"Hello file log"
);
rotating
->
info
(
"Hello rotating log"
);
daily
->
info
(
"Hello daily log"
);
auto
foss
=
f
(
"test2"
);
foss
.
str
();
//multi sink logger: file + console
auto
sink1
=
std
::
make_shared
<
c11log
::
sinks
::
stdout_sink_mt
>
();
auto
sink2
=
std
::
make_shared
<
c11log
::
sinks
::
daily_file_sink_mt
>
(
"rotating"
,
"txt"
);
c11log
::
logger
combined
(
"combined"
,
{
sink1
,
sink2
});
return
0
;
}
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