When a context is closed the current implementation will exit out of all logging without draining the channel first. This can cause logs to be lost because they are not pulled prior to exiting.
Each channel should be monitored using something like len of the channel to ensure that all logs are drained prior to exiting the logger. Obviously, this doesn't solve the case where the application is closed, but perhaps an option should be added to monitor for an os signal and drain remaining logs when that happens.
When a context is closed the current implementation will exit out of all logging without draining the channel first. This can cause logs to be lost because they are not pulled prior to exiting.
Each channel should be monitored using something like
lenof the channel to ensure that all logs are drained prior to exiting the logger. Obviously, this doesn't solve the case where the application is closed, but perhaps an option should be added to monitor for anossignal and drain remaining logs when that happens.