mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-12 17:00:25 +08:00
Remove inner try catch in SPDLOG_LOGGER_CATCH
The fmt::format call should not throw formatting the exception message and the source code location.
This commit is contained in:
parent
ed27592537
commit
0d10e21c2f
@ -32,16 +32,9 @@
|
|||||||
catch (const std::exception &ex) \
|
catch (const std::exception &ex) \
|
||||||
{ \
|
{ \
|
||||||
if(location.filename) \
|
if(location.filename) \
|
||||||
{ \
|
|
||||||
try \
|
|
||||||
{ \
|
{ \
|
||||||
err_handler_(fmt::format("{} [{}({})]", ex.what(), location.filename, location.line)); \
|
err_handler_(fmt::format("{} [{}({})]", ex.what(), location.filename, location.line)); \
|
||||||
} \
|
} \
|
||||||
catch (const std::exception &ex) \
|
|
||||||
{ \
|
|
||||||
err_handler_(ex.what()); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
err_handler_(ex.what()); \
|
err_handler_(ex.what()); \
|
||||||
|
Loading…
Reference in New Issue
Block a user