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
068a0e3a
Commit
068a0e3a
authored
Oct 10, 2014
by
gabi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some syntactic improvements
parent
b49b0867
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
line_logger.h
include/c11log/details/line_logger.h
+2
-3
logger.h
include/c11log/logger.h
+7
-10
No files found.
include/c11log/details/line_logger.h
View file @
068a0e3a
...
...
@@ -6,12 +6,11 @@
#include "fast_oss.h"
//
line_logger class.
// a
ggregates single log line (on the stack if possibe) and calls the logger
upon destruction
//
Line logger class - aggregates operator<< calls to fast ostream
// a
nd logs
upon destruction
namespace
c11log
{
namespace
details
{
class
line_logger
...
...
include/c11log/logger.h
View file @
068a0e3a
...
...
@@ -29,7 +29,7 @@ public:
using
sink_ptr
=
std
::
shared_ptr
<
sinks
::
isink
>
;
using
sinks_vector_t
=
std
::
vector
<
sink_ptr
>
;
using
sinks_init_list
=
std
::
initializer_list
<
sink_ptr
>
;
using
formatter_ptr
=
std
::
unique_ptr
<
c11log
::
formatters
::
formatter
>
;
using
formatter_ptr
=
std
::
unique_ptr
<
formatters
::
formatter
>
;
logger
(
const
std
::
string
&
name
,
sinks_init_list
,
formatter_ptr
=
nullptr
);
logger
(
const
std
::
string
&
name
,
sink_ptr
,
formatter_ptr
=
nullptr
);
...
...
@@ -37,12 +37,11 @@ public:
logger
&
operator
=
(
const
logger
&
)
=
delete
;
~
logger
()
=
default
;
void
level
(
c11log
::
level
::
level_enum
);
c11log
::
level
::
level_enum
level
()
const
;
void
level
(
level
::
level_enum
);
level
::
level_enum
level
()
const
;
const
std
::
string
&
name
()
const
;
bool
should_log
(
c11log
::
level
::
level_enum
)
const
;
bool
should_log
(
level
::
level_enum
)
const
;
template
<
typename
T
>
details
::
line_logger
trace
(
const
T
&
);
template
<
typename
T
>
details
::
line_logger
debug
(
const
T
&
);
...
...
@@ -60,11 +59,9 @@ public:
details
::
line_logger
critical
();
details
::
line_logger
fatal
();
private
:
friend
details
::
line_logger
;
std
::
string
_logger_name
;
std
::
string
_name
;
formatter_ptr
_formatter
;
sinks_vector_t
_sinks
;
std
::
atomic_int
_level
;
...
...
@@ -97,7 +94,7 @@ inline std::shared_ptr<c11log::logger> c11log::get_logger(const std::string& nam
inline
c11log
::
logger
::
logger
(
const
std
::
string
&
name
,
sinks_init_list
sinks_list
,
formatter_ptr
f
)
:
_
logger_
name
(
name
),
_name
(
name
),
_formatter
(
std
::
move
(
f
)),
_sinks
(
sinks_list
)
{
...
...
@@ -195,7 +192,7 @@ inline c11log::details::line_logger c11log::logger::fatal()
inline
const
std
::
string
&
c11log
::
logger
::
name
()
const
{
return
_
logger_
name
;
return
_name
;
}
inline
void
c11log
::
logger
::
level
(
c11log
::
level
::
level_enum
level
)
...
...
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