I use Log and Logger API for general logging needs in my custom packages on Linux and iOS. Everything works great.
On iOS I initialize the Log.logger (for historical reasons and cooperation with legacy code) with my custom implementation of https://github.com/CocoaLumberjack/CocoaLumberjack based Logger implementation.
Also works great. Except for one thing. CocoaLumberjack is high perf and highly async, and when my app crashes controllably, the last few most important log statements are lost.
For that CocoaLumberjack provides a method DDLog.flushLog https://github.com/CocoaLumberjack/CocoaLumberjack/blob/832adf8139ee8b9810683a110a2318a9ea225a5a/Sources/CocoaLumberjack/include/CocoaLumberjack/DDLog.h#L367.
I would like to open a PR to propose addition of Logger.flush() and Log.flush() methods that would allow my app to invoke these methods and propagate them down in order to make sure logging is flushed in cases where app is terminated in a controlled manner.
What do you think? How you achieve the same?
I use
LogandLoggerAPI for general logging needs in my custom packages on Linux and iOS. Everything works great.On iOS I initialize the
Log.logger(for historical reasons and cooperation with legacy code) with my custom implementation of https://github.com/CocoaLumberjack/CocoaLumberjack basedLoggerimplementation.Also works great. Except for one thing. CocoaLumberjack is high perf and highly async, and when my app crashes controllably, the last few most important log statements are lost.
For that CocoaLumberjack provides a method
DDLog.flushLoghttps://github.com/CocoaLumberjack/CocoaLumberjack/blob/832adf8139ee8b9810683a110a2318a9ea225a5a/Sources/CocoaLumberjack/include/CocoaLumberjack/DDLog.h#L367.I would like to open a PR to propose addition of
Logger.flush()andLog.flush()methods that would allow my app to invoke these methods and propagate them down in order to make sure logging is flushed in cases where app is terminated in a controlled manner.What do you think? How you achieve the same?