Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
d0dcc13f
Commit
d0dcc13f
authored
Dec 08, 2014
by
gabi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small cleanup
parent
65a1e569
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
25 deletions
+18
-25
include/spdlog/details/line_logger.h
include/spdlog/details/line_logger.h
+12
-10
include/spdlog/details/logger_impl.h
include/spdlog/details/logger_impl.h
+6
-15
No files found.
include/spdlog/details/line_logger.h
View file @
d0dcc13f
...
...
@@ -69,25 +69,27 @@ public:
}
}
template
<
typename
T
>
void
write
(
const
T
&
what
)
{
if
(
_enabled
)
{
_log_msg
.
raw
<<
what
;
}
}
template
<
typename
...
Args
>
void
write
(
const
std
::
string
&
fmt
,
const
Args
&
...
args
)
{
_log_msg
.
raw
.
write
(
fmt
,
args
...);
if
(
!
_enabled
)
return
;
try
{
_log_msg
.
raw
.
write
(
fmt
,
args
...);
}
catch
(
const
fmt
::
FormatError
&
e
)
{
throw
spdlog_ex
(
fmt
::
format
(
"formatting error while processing format string '{}': {}"
,
fmt
,
e
.
what
()));
}
}
template
<
typename
T
>
line_logger
&
operator
<<
(
const
T
&
what
)
{
write
(
what
);
if
(
_enabled
)
_log_msg
.
raw
<<
what
;
return
*
this
;
}
...
...
include/spdlog/details/logger_impl.h
View file @
d0dcc13f
...
...
@@ -71,18 +71,7 @@ inline spdlog::details::line_logger spdlog::logger::_log(level::level_enum lvl,
{
bool
msg_enabled
=
should_log
(
lvl
);
details
::
line_logger
l
(
this
,
lvl
,
msg_enabled
);
if
(
msg_enabled
)
{
try
{
l
.
write
(
fmt
,
args
...);
}
catch
(
const
fmt
::
FormatError
&
e
)
{
throw
spdlog_ex
(
fmt
::
format
(
"formatting error while processing format string '{}': {}"
,
fmt
,
e
.
what
()));
}
}
l
.
write
(
fmt
,
args
...);
return
l
;
}
...
...
@@ -151,7 +140,6 @@ inline spdlog::details::line_logger spdlog::logger::emerg(const std::string& fmt
// //API to support logger.info() << ".." calls
//
inline
spdlog
::
details
::
line_logger
spdlog
::
logger
::
_log
(
level
::
level_enum
lvl
)
{
bool
msg_enabled
=
should_log
(
lvl
);
...
...
@@ -213,7 +201,8 @@ inline spdlog::details::line_logger spdlog::logger::emerg()
//
// name and level
//
inline
const
std
::
string
&
spdlog
::
logger
::
name
()
const
{
return
_name
;
...
...
@@ -239,7 +228,9 @@ inline void spdlog::logger::stop()
_stop
();
}
/* protected virtual */
//
// protected virtual called at end of each user log call (if enabled) by the line_logger
//
inline
void
spdlog
::
logger
::
_log_msg
(
details
::
log_msg
&
msg
)
{
_formatter
->
format
(
msg
);
...
...
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