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
e6345e00
Commit
e6345e00
authored
Oct 18, 2014
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gcc warnings fix
parent
5f4d4d09
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
18 deletions
+18
-18
bench.cpp
example/bench.cpp
+3
-3
example.cpp
example/example.cpp
+1
-1
fast_oss.h
include/c11log/details/fast_oss.h
+7
-7
stack_buf.h
include/c11log/details/stack_buf.h
+1
-0
logger.h
include/c11log/logger.h
+6
-7
No files found.
example/bench.cpp
View file @
e6345e00
...
...
@@ -37,9 +37,9 @@ int main(int argc, char* argv[])
auto
delta
=
system_clock
::
now
()
-
start
;
auto
delta_d
=
duration_cast
<
duration
<
double
>>
(
delta
).
count
();
cout
<<
"Total:"
<<
format
(
howmany
)
<<
endl
;
cout
<<
"Delta:"
<<
format
(
delta_d
)
<<
endl
;
cout
<<
"Rate:"
<<
format
(
howmany
/
delta_d
)
<<
"/sec"
<<
endl
;
cout
_logger
.
info
(
"Total:"
)
<<
format
(
howmany
)
;
cout
_logger
.
info
(
"Delta:"
)
<<
format
(
delta_d
)
;
cout
_logger
.
info
(
"Rate:"
)
<<
format
(
howmany
/
delta_d
)
<<
"/sec"
;
return
0
;
}
...
...
example/example.cpp
View file @
e6345e00
...
...
@@ -9,7 +9,7 @@
#include "c11log/sinks/file_sinks.h"
using
namespace
std
;
int
main
2
(
int
,
char
*
[])
int
main
(
int
,
char
*
[])
{
auto
console
=
c11log
::
factory
::
stdout_logger
();
...
...
include/c11log/details/fast_oss.h
View file @
e6345e00
...
...
@@ -89,9 +89,9 @@ public:
std
::
string
str
()
{
auto
buf
=
_dev
.
buf
();
const
char
*
data
=
buf
.
data
();
return
std
::
string
(
data
,
data
+
buf
.
size
());
auto
buf
fer
=
_dev
.
buf
();
const
char
*
data
=
buf
fer
.
data
();
return
std
::
string
(
data
,
data
+
buf
fer
.
size
());
}
const
stack_devicebuf
::
stackbuf_t
&
buf
()
const
...
...
@@ -133,11 +133,11 @@ public:
void
write_fast_oss
(
const
fast_oss
&
oss
)
{
auto
buf
=
oss
.
buf
();
_dev
.
sputn
(
buf
.
data
(),
buf
.
size
());
auto
buf
fer
=
oss
.
buf
();
_dev
.
sputn
(
buf
fer
.
data
(),
buffer
.
size
());
}
private
:
stack_devicebuf
_dev
;
};
...
...
include/c11log/details/stack_buf.h
View file @
e6345e00
...
...
@@ -3,6 +3,7 @@
#include <algorithm>
#include <array>
#include <vector>
#include <cstring>
// Fast memory storage on the stack when possible or in std::vector
...
...
include/c11log/logger.h
View file @
e6345e00
...
...
@@ -29,7 +29,7 @@ class logger
{
public
:
using
sink_ptr
=
std
::
shared_ptr
<
sinks
::
sink
>
;
using
formatter_ptr
=
std
::
shared_ptr
<
formatter
>
;
using
formatter_ptr
=
std
::
shared_ptr
<
c11log
::
formatter
>
;
logger
(
const
std
::
string
&
name
,
std
::
initializer_list
<
sink_ptr
>
,
formatter_ptr
formatter
=
nullptr
);
template
<
class
It
>
...
...
@@ -93,12 +93,12 @@ private:
#include "details/line_logger.h"
inline
c11log
::
logger
::
logger
(
const
std
::
string
&
logger_name
,
std
::
initializer_list
<
sink_ptr
>
sinks_list
,
formatter_ptr
formatter
)
:
inline
c11log
::
logger
::
logger
(
const
std
::
string
&
logger_name
,
std
::
initializer_list
<
sink_ptr
>
sinks_list
,
formatter_ptr
msg_
formatter
)
:
_name
(
logger_name
),
_formatter
(
formatter
),
_formatter
(
msg_
formatter
),
_sinks
(
sinks_list
)
{
if
(
!
formatter
)
//default formatter
if
(
!
msg_
formatter
)
//default formatter
_formatter
=
std
::
make_shared
<
details
::
pattern_formatter
>
(
_default_pattern
);
// no support under vs2013 for member initialization for std::atomic
...
...
@@ -169,10 +169,9 @@ inline bool c11log::logger::should_log(c11log::level::level_enum msg_level) cons
return
msg_level
>=
_level
.
load
();
}
inline
void
c11log
::
logger
::
formatter
(
formatter_ptr
formatter
)
inline
void
c11log
::
logger
::
formatter
(
formatter_ptr
msg_formatter
)
{
_formatter
=
formatter
;
_formatter
=
msg_
formatter
;
}
inline
c11log
::
logger
::
formatter_ptr
c11log
::
logger
::
formatter
()
const
...
...
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