spdlog
spdlog copied to clipboard
spdlog_ex is thrown when logging fails
Currently when logging fails there's an exception thrown that crashes the app:
https://github.com/gabime/spdlog/blob/a9347017db7bba66a070a92235eafc618d0ef087/include/spdlog/sinks/android_sink.h#L69
throw_spdlog_ex("logging to Android failed", ret);
Is it possible to prevent from Spdlog to crash in this case without modifying Spdlog code?
No. If throw from sink via spdlo::logger API, the exception will be catch inside spdlog.
See Wiki: https://github.com/gabime/spdlog/wiki/Error-handling
Yes, I have the same error as you, is there a solution? Core was generated #0 0x00002b5d7e491387 in raise () from /lib64/libc.so.6 #1 0x00002b5d7e492a78 in abort () from /lib64/libc.so.6 #2 0x00002b5d7d15e7d5 in __gnu_cxx::__verbose_terminate_handler() () from /lib64/libstdc++.so.6 #3 0x00002b5d7d15c746 in ?? () from /lib64/libstdc++.so.6 #4 0x00002b5d7d15c773 in std::terminate() () from /lib64/libstdc++.so.6 #5 0x00002b5d7d15c993 in cxa_throw () from /lib64/libstdc++.so.6 #6 0x00000000004b30f4 in spdlog::throw_spdlog_ex (msg="") at /spdlog-1.9.2/include/spdlog/common-inl.h:75 #7 0x00000000004b76a2 in spdlog::async_logger::sink_it (this=0x4967410, msg=...) at /spdlog-1.9.2/include/spdlog/async_logger-inl.h:35 #8 0x00000000004b65aa in spdlog::logger::log_it (this=0x4967410, log_msg=..., log_enabled=true, traceback_enabled=false) at /spdlog-1.9.2/include/spdlog/logger-inl.h:170 #9 0x00000000004b451c in spdlog::logger::log (this=0x4967410, loc=..., lvl=spdlog::level::debug, msg=...) at /spdlog-1.9.2/include/spdlog/logger.h:135 #10 0x00000000004c9060 in spdlog::logger::log<char [40], 0> (this=0x4967410, loc=..., lvl=spdlog::level::debug, msg=...) at /spdlog-1.9.2/include/spdlog/logger.h:102
@gabime why was this closed ? it does reproduce for others
@danrevah Please provide code to reproduce.