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
bfbb4e40
Commit
bfbb4e40
authored
6 years ago
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some err handler cleanup
parent
2aceb13f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
logger.h
include/spdlog/logger.h
+3
-2
logger.cpp
src/logger.cpp
+1
-1
No files found.
include/spdlog/logger.h
View file @
bfbb4e40
...
...
@@ -32,6 +32,7 @@ namespace spdlog {
class
logger
{
public
:
using
err_handler
=
void
(
*
)(
const
std
::
string
&
msg
);
template
<
typename
It
>
logger
(
std
::
string
name
,
It
begin
,
It
end
)
:
name_
(
std
::
move
(
name
))
...
...
@@ -318,7 +319,7 @@ public:
std
::
vector
<
sink_ptr
>
&
sinks
();
// error handler
void
set_error_handler
(
void
(
*
handler
)(
const
std
::
string
&
msg
)
);
void
set_error_handler
(
err_handler
);
// create new logger with same sinks and configuration.
virtual
std
::
shared_ptr
<
logger
>
clone
(
std
::
string
logger_name
);
...
...
@@ -340,7 +341,7 @@ public:
std
::
vector
<
sink_ptr
>
sinks_
;
spdlog
::
level_t
level_
{
spdlog
::
logger
::
default_level
()};
spdlog
::
level_t
flush_level_
{
level
::
off
};
void
(
*
custom_err_handler_
)(
const
std
::
string
&
msg
)
{
nullptr
};
err_handler
custom_err_handler_
{
nullptr
};
};
...
...
This diff is collapsed.
Click to expand it.
src/logger.cpp
View file @
bfbb4e40
...
...
@@ -113,7 +113,7 @@ SPDLOG_INLINE std::vector<spdlog::sink_ptr> &spdlog::logger::sinks()
}
// error handler
SPDLOG_INLINE
void
spdlog
::
logger
::
set_error_handler
(
void
(
*
handler
)(
const
std
::
string
&
msg
)
)
SPDLOG_INLINE
void
spdlog
::
logger
::
set_error_handler
(
err_handler
handler
)
{
custom_err_handler_
=
handler
;
}
...
...
This diff is collapsed.
Click to expand it.
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