aui
aui copied to clipboard
ALogger: per tag logging level
Describe the need of your project
Need ALogger API expansion to support additional logging levels:
FATALERRORWARNINFODEBUGTRACE
Also, an API to support per-tag logging levels is required.
The code in ALogger is relatively old, so clean up and opinionated suggestions are welcome.
Proposed solution
- Code style reformat.
- Add new logging levels.
- API to set per-tag logging levels, i.e.,
ALogger::setLogLevel("Performance", TRACE);- since this might involve an access to std::map, I suggest caching log level somewhere in
static constexpr auto LOG_TAGwhich is spreaded across my code
- since this might involve an access to std::map, I suggest caching log level somewhere in
- Maybe we can borrow something from existing C++ logging implementations, i.e., from userver (A.Polukhin has a talk about logging on youtube that can be configured at runtime - this is exactly what I want)
Alternatives you've considered
We can delegate logging to an external well-accepted library, although I don't really want to introduce an external dependency.
Additional context
Client's code is highly multithreaded, so if we can get rid of mutex lock/unlock per log invocation, that would be awesome.