aui icon indicating copy to clipboard operation
aui copied to clipboard

ALogger: per tag logging level

Open Alex2772 opened this issue 5 months ago • 0 comments

Describe the need of your project

Need ALogger API expansion to support additional logging levels:

  • FATAL
  • ERROR
  • WARN
  • INFO
  • DEBUG
  • TRACE

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_TAG which is spreaded across my code
  • 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.

Alex2772 avatar Jul 25 '25 11:07 Alex2772