2014-03-02 08:59:18 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <chrono>
|
|
|
|
|
2014-03-06 17:52:50 -05:00
|
|
|
namespace c11log
|
|
|
|
{
|
2014-03-02 08:59:18 -05:00
|
|
|
|
|
|
|
typedef std::chrono::system_clock log_clock;
|
|
|
|
|
2014-03-06 17:52:50 -05:00
|
|
|
namespace level
|
|
|
|
{
|
2014-03-02 08:59:18 -05:00
|
|
|
typedef enum {
|
|
|
|
DEBUG,
|
|
|
|
INFO,
|
|
|
|
WARNING,
|
|
|
|
ERROR,
|
|
|
|
FATAL,
|
|
|
|
NONE = 99
|
|
|
|
} level_enum;
|
|
|
|
const char* to_str(level_enum l);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-08 09:18:57 -05:00
|
|
|
static const char* level_names[] { "debug", "info", "warning", "error", "fatal" };
|
2014-03-02 08:59:18 -05:00
|
|
|
inline const char* c11log::level::to_str(c11log::level::level_enum l)
|
|
|
|
{
|
|
|
|
return level_names[l];
|
|
|
|
}
|
|
|
|
|