It'd be very useful to have the global logger be init'd so it is thread local. This could be a significant breaking change to library users, so I'd suggest it was done using a compile-time feature.
Why?
- Occasionally, logging can be quite expensive for some binaries, particularly if they are using one of the newer cloud services. In this world, one runs a second logging thread and has log requests forwarded to it (eg using
thread::mpsc).
- For larger server projects, logging needs may also vary for different parts of the code base:-
- The main thread is used only for startup, option parsing and shutdown, and has very little in the way of logging needs, but if it does log, should log to standard error
- The main application threads (eg socket listeners) need to log to a monitored cloud service, so pass their logging requests to a third logging thread
- The logging thread receives log requests and forwards them on. It itself may need a logger that talks, say, to local syslog.
What do you think?
It'd be very useful to have the global logger be init'd so it is thread local. This could be a significant breaking change to library users, so I'd suggest it was done using a compile-time feature.
Why?
thread::mpsc).What do you think?