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
e9635c7b
Commit
e9635c7b
authored
May 01, 2021
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rethrnow non std exceptions to fix #533
parent
8e3b1338
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
15 deletions
+17
-15
include/spdlog/common.h
include/spdlog/common.h
+3
-2
include/spdlog/details/thread_pool-inl.h
include/spdlog/details/thread_pool-inl.h
+1
-1
include/spdlog/logger.h
include/spdlog/logger.h
+13
-12
No files found.
include/spdlog/common.h
View file @
e9635c7b
...
@@ -71,11 +71,12 @@
...
@@ -71,11 +71,12 @@
printf("spdlog fatal error: %s\n", ex.what()); \
printf("spdlog fatal error: %s\n", ex.what()); \
std::abort(); \
std::abort(); \
} while (0)
} while (0)
#define SPDLOG_CATCH_
ALL()
#define SPDLOG_CATCH_
STD
#else
#else
#define SPDLOG_TRY try
#define SPDLOG_TRY try
#define SPDLOG_THROW(ex) throw(ex)
#define SPDLOG_THROW(ex) throw(ex)
#define SPDLOG_CATCH_ALL() catch (...)
#define SPDLOG_CATCH_STD \
catch (const std::exception &) {}
#endif
#endif
namespace
spdlog
{
namespace
spdlog
{
...
...
include/spdlog/details/thread_pool-inl.h
View file @
e9635c7b
...
@@ -49,7 +49,7 @@ SPDLOG_INLINE thread_pool::~thread_pool()
...
@@ -49,7 +49,7 @@ SPDLOG_INLINE thread_pool::~thread_pool()
t
.
join
();
t
.
join
();
}
}
}
}
SPDLOG_CATCH_
ALL
()
{}
SPDLOG_CATCH_
STD
}
}
void
SPDLOG_INLINE
thread_pool
::
post_log
(
async_logger_ptr
&&
worker_ptr
,
const
details
::
log_msg
&
msg
,
async_overflow_policy
overflow_policy
)
void
SPDLOG_INLINE
thread_pool
::
post_log
(
async_logger_ptr
&&
worker_ptr
,
const
details
::
log_msg
&
msg
,
async_overflow_policy
overflow_policy
)
...
...
include/spdlog/logger.h
View file @
e9635c7b
...
@@ -31,7 +31,8 @@
...
@@ -31,7 +31,8 @@
} \
} \
catch (...) \
catch (...) \
{ \
{ \
err_handler_("Unknown exception in logger"); \
err_handler_("Rethrowing unknown exception in logger"); \
throw; \
}
}
#else
#else
#define SPDLOG_LOGGER_CATCH()
#define SPDLOG_LOGGER_CATCH()
...
@@ -75,56 +76,56 @@ public:
...
@@ -75,56 +76,56 @@ public:
// FormatString is a type derived from fmt::compile_string
// FormatString is a type derived from fmt::compile_string
template
<
typename
FormatString
,
typename
std
::
enable_if
<
fmt
::
is_compile_string
<
FormatString
>
::
value
,
int
>::
type
=
0
,
typename
...
Args
>
template
<
typename
FormatString
,
typename
std
::
enable_if
<
fmt
::
is_compile_string
<
FormatString
>
::
value
,
int
>::
type
=
0
,
typename
...
Args
>
void
log
(
source_loc
loc
,
level
::
level_enum
lvl
,
const
FormatString
&
fmt
,
Args
&&
...
args
)
void
log
(
source_loc
loc
,
level
::
level_enum
lvl
,
const
FormatString
&
fmt
,
Args
&&
...
args
)
{
{
log_
(
loc
,
lvl
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
log_
(
loc
,
lvl
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
}
}
// FormatString is NOT a type derived from fmt::compile_string but is a string_view_t or can be implicitly converted to one
// FormatString is NOT a type derived from fmt::compile_string but is a string_view_t or can be implicitly converted to one
template
<
typename
...
Args
>
template
<
typename
...
Args
>
void
log
(
source_loc
loc
,
level
::
level_enum
lvl
,
string_view_t
fmt
,
Args
&&
...
args
)
void
log
(
source_loc
loc
,
level
::
level_enum
lvl
,
string_view_t
fmt
,
Args
&&
...
args
)
{
{
log_
(
loc
,
lvl
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
log_
(
loc
,
lvl
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
}
}
template
<
typename
FormatString
,
typename
...
Args
>
template
<
typename
FormatString
,
typename
...
Args
>
void
log
(
level
::
level_enum
lvl
,
const
FormatString
&
fmt
,
Args
&&
...
args
)
void
log
(
level
::
level_enum
lvl
,
const
FormatString
&
fmt
,
Args
&&
...
args
)
{
{
log
(
source_loc
{},
lvl
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
log
(
source_loc
{},
lvl
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
}
}
template
<
typename
FormatString
,
typename
...
Args
>
template
<
typename
FormatString
,
typename
...
Args
>
void
trace
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
void
trace
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
{
{
log
(
level
::
trace
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
log
(
level
::
trace
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
}
}
template
<
typename
FormatString
,
typename
...
Args
>
template
<
typename
FormatString
,
typename
...
Args
>
void
debug
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
void
debug
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
{
{
log
(
level
::
debug
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
log
(
level
::
debug
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
}
}
template
<
typename
FormatString
,
typename
...
Args
>
template
<
typename
FormatString
,
typename
...
Args
>
void
info
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
void
info
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
{
{
log
(
level
::
info
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
log
(
level
::
info
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
}
}
template
<
typename
FormatString
,
typename
...
Args
>
template
<
typename
FormatString
,
typename
...
Args
>
void
warn
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
void
warn
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
{
{
log
(
level
::
warn
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
log
(
level
::
warn
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
}
}
template
<
typename
FormatString
,
typename
...
Args
>
template
<
typename
FormatString
,
typename
...
Args
>
void
error
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
void
error
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
{
{
log
(
level
::
err
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
log
(
level
::
err
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
}
}
template
<
typename
FormatString
,
typename
...
Args
>
template
<
typename
FormatString
,
typename
...
Args
>
void
critical
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
void
critical
(
const
FormatString
&
fmt
,
Args
&&
...
args
)
{
{
log
(
level
::
critical
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
log
(
level
::
critical
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
}
}
...
@@ -225,7 +226,7 @@ public:
...
@@ -225,7 +226,7 @@ public:
#else
#else
template
<
typename
...
Args
>
template
<
typename
...
Args
>
void
log
(
source_loc
loc
,
level
::
level_enum
lvl
,
wstring_view_t
fmt
,
Args
&&
...
args
)
void
log
(
source_loc
loc
,
level
::
level_enum
lvl
,
wstring_view_t
fmt
,
Args
&&
...
args
)
{
{
bool
log_enabled
=
should_log
(
lvl
);
bool
log_enabled
=
should_log
(
lvl
);
bool
traceback_enabled
=
tracer_
.
enabled
();
bool
traceback_enabled
=
tracer_
.
enabled
();
...
@@ -326,7 +327,7 @@ protected:
...
@@ -326,7 +327,7 @@ protected:
// common implementation for after templated public api has been resolved
// common implementation for after templated public api has been resolved
template
<
typename
FormatString
,
typename
...
Args
>
template
<
typename
FormatString
,
typename
...
Args
>
void
log_
(
source_loc
loc
,
level
::
level_enum
lvl
,
const
FormatString
&
fmt
,
Args
&&
...
args
)
void
log_
(
source_loc
loc
,
level
::
level_enum
lvl
,
const
FormatString
&
fmt
,
Args
&&
...
args
)
{
{
bool
log_enabled
=
should_log
(
lvl
);
bool
log_enabled
=
should_log
(
lvl
);
bool
traceback_enabled
=
tracer_
.
enabled
();
bool
traceback_enabled
=
tracer_
.
enabled
();
...
...
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