changed things to include plog
This commit is contained in:
parent
b018a44f10
commit
68a1618743
34 changed files with 2702 additions and 27 deletions
61
include/plog/Severity.h
Normal file
61
include/plog/Severity.h
Normal file
|
@ -0,0 +1,61 @@
|
|||
#pragma once
|
||||
#include <cctype>
|
||||
|
||||
namespace plog
|
||||
{
|
||||
enum Severity
|
||||
{
|
||||
none = 0,
|
||||
fatal = 1,
|
||||
error = 2,
|
||||
warning = 3,
|
||||
info = 4,
|
||||
debug = 5,
|
||||
verbose = 6
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(suppress: 26812) // Prefer 'enum class' over 'enum'
|
||||
#endif
|
||||
inline const char* severityToString(Severity severity)
|
||||
{
|
||||
switch (severity)
|
||||
{
|
||||
case fatal:
|
||||
return "FATAL";
|
||||
case error:
|
||||
return "ERROR";
|
||||
case warning:
|
||||
return "WARN";
|
||||
case info:
|
||||
return "INFO";
|
||||
case debug:
|
||||
return "DEBUG";
|
||||
case verbose:
|
||||
return "VERB";
|
||||
default:
|
||||
return "NONE";
|
||||
}
|
||||
}
|
||||
|
||||
inline Severity severityFromString(const char* str)
|
||||
{
|
||||
switch (std::toupper(str[0]))
|
||||
{
|
||||
case 'F':
|
||||
return fatal;
|
||||
case 'E':
|
||||
return error;
|
||||
case 'W':
|
||||
return warning;
|
||||
case 'I':
|
||||
return info;
|
||||
case 'D':
|
||||
return debug;
|
||||
case 'V':
|
||||
return verbose;
|
||||
default:
|
||||
return none;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue