ulog: Flexible asynchronous logging
ulogsends all log messages through a channel to another thread as soon as possible, trying to minimize the time the logging thread spends processing the log.
uloguses the de-facto standard logging facade of log, allowing access to familiar features.
ulogis small but flexible, allowing different use cases other than standard file or stream logging. Log handling is done by passing a closure that is executed in a different thread.
ulog is intended for use on embedded Linux applications that are
multithreaded and require a single thread to provide hard real-time
guarantees. Logs made using
ulog are sent through a synchronous
before being processed, if logging cannot be completed in constant time,
the message is dropped and an error flag is set.
Consider an application controlling a piece of hardware that has moderate real-time guarantees (in the 10s of milliseconds). Allocations and other execution will usually run just fine, however writing logs to disk or stderr can occasionally slow down the process by hundres of millliseconds under some conditions.
To avoid this,
ulog can be used to offloaded heavy I/O into a separate
thread, if enough execution threads are available and scheduling is setup
correctly, this will guarantee that logging never takes longer than a
string format and a few small allocations.
A log entry
Initialize ulog logging.
Initialize ulog loggin with default