added logging module and a sandbox project

This commit is contained in:
Sascha Kühl
2025-07-03 16:13:58 +02:00
parent c4a00f19fd
commit 20d6a77275
29 changed files with 2287 additions and 25 deletions
+43
View File
@@ -0,0 +1,43 @@
#ifndef MATADOR_LOG_LEVEL_HPP
#define MATADOR_LOG_LEVEL_HPP
#include <iosfwd>
namespace matador::logger {
/**
* Represents all available log levels
*/
enum class log_level
{
LVL_FATAL, /**< If a serious error occurred, use FATAL level */
LVL_ERROR, /**< On error use ERROR level */
LVL_WARN, /**< Warnings should use WARN level */
LVL_INFO, /**< Information should go with INFO level */
LVL_DEBUG, /**< Debug output should use DEBUG level */
LVL_TRACE, /**< Trace information should use TRACE level */
LVL_ALL /**< This level represents all log levels and should be used for logging */
};
/**
* Write log level in a human-readable string
* to a given std::ostream.
*
* @param os std::stream to write to
* @param lvl Log level to write
* @return The std::ostream
*/
std::ostream& operator<<(std::ostream &os, log_level lvl);
/// @cond MATADOR_DEV
struct log_level_range
{
log_level min_level = log_level::LVL_INFO;
log_level max_level = log_level::LVL_FATAL;
};
/// @endcond
}
#endif //MATADOR_LOG_LEVEL_HPP