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
12df1725
Unverified
Commit
12df1725
authored
Jun 16, 2021
by
Gabi Melman
Committed by
GitHub
Jun 16, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1971 from SpriteOvO/v1.x
Use std::function for the global error handler
parents
7a7611e9
7fa751d3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
include/spdlog/details/registry-inl.h
include/spdlog/details/registry-inl.h
+2
-2
include/spdlog/details/registry.h
include/spdlog/details/registry.h
+2
-2
No files found.
include/spdlog/details/registry-inl.h
View file @
12df1725
...
...
@@ -195,14 +195,14 @@ SPDLOG_INLINE void registry::flush_every(std::chrono::seconds interval)
periodic_flusher_
=
details
::
make_unique
<
periodic_worker
>
(
clbk
,
interval
);
}
SPDLOG_INLINE
void
registry
::
set_error_handler
(
void
(
*
handler
)(
const
std
::
string
&
msg
)
)
SPDLOG_INLINE
void
registry
::
set_error_handler
(
err_handler
handler
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
logger_map_mutex_
);
for
(
auto
&
l
:
loggers_
)
{
l
.
second
->
set_error_handler
(
handler
);
}
err_handler_
=
handler
;
err_handler_
=
std
::
move
(
handler
)
;
}
SPDLOG_INLINE
void
registry
::
apply_all
(
const
std
::
function
<
void
(
const
std
::
shared_ptr
<
logger
>
)
>
&
fun
)
...
...
include/spdlog/details/registry.h
View file @
12df1725
...
...
@@ -63,7 +63,7 @@ public:
void
flush_every
(
std
::
chrono
::
seconds
interval
);
void
set_error_handler
(
void
(
*
handler
)(
const
std
::
string
&
msg
)
);
void
set_error_handler
(
err_handler
handler
);
void
apply_all
(
const
std
::
function
<
void
(
const
std
::
shared_ptr
<
logger
>
)
>
&
fun
);
...
...
@@ -99,7 +99,7 @@ private:
std
::
unique_ptr
<
formatter
>
formatter_
;
spdlog
::
level
::
level_enum
global_log_level_
=
level
::
info
;
level
::
level_enum
flush_level_
=
level
::
off
;
void
(
*
err_handler_
)(
const
std
::
string
&
msg
)
=
nullptr
;
err_handler
err_handler_
;
std
::
shared_ptr
<
thread_pool
>
tp_
;
std
::
unique_ptr
<
periodic_worker
>
periodic_flusher_
;
std
::
shared_ptr
<
logger
>
default_logger_
;
...
...
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