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
4728b41e
Commit
4728b41e
authored
Nov 03, 2014
by
gabi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated readme and example.cpp
parent
52598c81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
README.md
README.md
+12
-11
example.cpp
example/example.cpp
+3
-3
No files found.
README.md
View file @
4728b41e
...
...
@@ -13,19 +13,20 @@ Just copy the files to your build tree and use a C++11 compiler
*
visual studio 2013
##Features
*
Very low overhead
*
Stream like, easy to use interface
*
Logging levels
*
Very fast - performance is the primary goal
*
Headers only
*
No dependencies
*
Cross platform - Linux / Windows on 32/64 bits
*
Mult/Single threaded loggers
*
Rotating log files
*
Daily log files
*
Async
logging
*
Thread safety
*
Custom formatting
*
Console
logging
*
Async logging
*
*
Logging levels
*
Custom formatting with user defined patterns
## Performance
The library is very fast.
Here are some benchmarks (Ubuntu, Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz)
## Benchmarks
Here are some benchmarks (Ubuntu 64 bits, Intel i7-4770 CPU @ 3.40GHz)
```
*******************************************************************************
Single thread, 250,000 iterations, flush every 1000 lines
...
...
@@ -52,7 +53,7 @@ int main(int, char* [])
try
{
std::string filename = "spdlog_example";
auto console = spd::std
err
_logger_mt("console");
auto console = spd::std
out
_logger_mt("console");
console->info("Welcome to spdlog!") ;
console->info() << "Creating file " << filename << "..";
...
...
example/example.cpp
View file @
4728b41e
...
...
@@ -44,8 +44,8 @@ int main(int, char* [])
//Create console, multithreaded logger
auto
console
=
spd
::
stdout_logger_mt
(
"console"
);
console
->
info
(
"Welcome to spdlog!"
)
;
console
->
info
(
"
Varriadic template call are supproted
"
,
"..."
,
1
,
2
,
3.5
);
console
->
info
()
<<
"
s
treams are supported too "
<<
std
::
setw
(
5
)
<<
std
::
setfill
(
'0'
)
<<
1
;
console
->
info
(
"
An info message example
"
,
"..."
,
1
,
2
,
3.5
);
console
->
info
()
<<
"
S
treams are supported too "
<<
std
::
setw
(
5
)
<<
std
::
setfill
(
'0'
)
<<
1
;
//Create a file rotating logger with 5mb size max and 3 rotated files
auto
file_logger
=
spd
::
rotating_logger_mt
(
"file_logger"
,
filename
,
1024
*
1024
*
5
,
3
);
...
...
@@ -53,7 +53,7 @@ int main(int, char* [])
for
(
int
i
=
0
;
i
<
100
;
++
i
)
{
file_logger
->
info
(
i
,
"in hex is"
,
"0x"
)
<<
std
::
hex
<<
std
::
uppercase
<<
i
;
file_logger
->
info
(
i
,
"in hex is"
,
"0x"
)
<<
std
::
hex
<<
std
::
uppercase
<<
i
;
}
spd
::
set_pattern
(
"*** [%H:%M:%S %z] [thread %t] %v ***"
);
...
...
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