/Mini-Log

minimal Logging Lib

Primary LanguageC++

Mini-Log

Mini-Log is a minimum structual-logging library. Header-Only and simple to use.

How to use Mini-Log

  1. get boost
  2. Clone Mini-Log into your project-folder
  3. include miniLog.hpp
  4. include
  5. set a 'const std::string log_path {"./my/relative/path/to/log.txt"};'
  6. build a 'miniLog::miniLogger myLogger{log_path, "Application Name"};'

There is your Logger.

When it comes to compilation, please add -lboost_system to your compiler-flags.

Log a Message

Mini-Log has a miniMessage Type. If you want to log a message just use

miniLog::miniMessage myMessage{miniLog::message_T::status, std::string{"my status message"}

If you finally want to write your message apply it with myLogger.log(myMessage); Mini-Log also features miniLog::miniMessage_T::error and miniLog::miniMessage_T::warning.

Mini-Log will append all messages in that file. To clear it, simply rm your logfile.txt.