Skip to content

Introduce Aidge::Log facility for messages logging

Olivier BICHLER requested to merge log into dev

Context

Right now, Aidge lacks a simple and uniform log system (see aidge#34 (closed)).

Several C++ log libraries based on fmt exist, like fmtlog or spdlog, but the very simple need for Aidge, which is not intended to be a continously running server application, does not seem to justify adding an extra dependency and the possible associated overhead.

Therefore, this proposal only brings the following functionalities:

  • 6 logging functions for 6 log levels (debug, info, notice, warn, error, fatal) that are clearly defined;
  • Possibility to save log messages in a file: enable, disable and change file at runtime;
  • Possibility to choose the log level for console and for file at runtime;
  • Compile-time removal of the debug level for Release.

Modified files

  • Log.hpp and Log.cpp, added new Log class;
  • Test_Log.hpp, added simple unit test;
  • ErrorHandling.hpp, modified to use Aidge::Log.
Edited by Olivier BICHLER

Merge request reports

Loading