mirror of https://github.com/AxioDL/logvisor.git
Namespace refactor / symbol changes
This commit is contained in:
parent
81af37641c
commit
05e8742f5d
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
extern "C" void LogVisorBp();
|
extern "C" void LogVisorBp();
|
||||||
|
|
||||||
namespace LogVisor
|
namespace logvisor
|
||||||
{
|
{
|
||||||
|
|
||||||
#if _WIN32 && UNICODE
|
#if _WIN32 && UNICODE
|
||||||
|
@ -29,7 +29,7 @@ enum Level
|
||||||
Info, /**< Non-error informative message */
|
Info, /**< Non-error informative message */
|
||||||
Warning, /**< Non-error warning message */
|
Warning, /**< Non-error warning message */
|
||||||
Error, /**< Recoverable error message */
|
Error, /**< Recoverable error message */
|
||||||
FatalError /**< Non-recoverable error message (throws exception) */
|
Fatal /**< Non-recoverable error message (throws exception) */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -122,11 +122,11 @@ void RegisterFileLogger(const wchar_t* filepath);
|
||||||
/**
|
/**
|
||||||
* @brief This is constructed per-subsystem in a locally centralized fashon
|
* @brief This is constructed per-subsystem in a locally centralized fashon
|
||||||
*/
|
*/
|
||||||
class LogModule
|
class Module
|
||||||
{
|
{
|
||||||
const char* m_modName;
|
const char* m_modName;
|
||||||
public:
|
public:
|
||||||
LogModule(const char* modName) : m_modName(modName) {}
|
Module(const char* modName) : m_modName(modName) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Route new log message to centralized ILogger
|
* @brief Route new log message to centralized ILogger
|
||||||
|
@ -152,9 +152,9 @@ public:
|
||||||
logger->report(m_modName, severity, format, apc);
|
logger->report(m_modName, severity, format, apc);
|
||||||
va_end(apc);
|
va_end(apc);
|
||||||
}
|
}
|
||||||
if (severity == Error || severity == FatalError)
|
if (severity == Error || severity == Fatal)
|
||||||
LogVisorBp();
|
LogVisorBp();
|
||||||
if (severity == FatalError)
|
if (severity == Fatal)
|
||||||
abort();
|
abort();
|
||||||
else if (severity == Error)
|
else if (severity == Error)
|
||||||
++ErrorCount;
|
++ErrorCount;
|
||||||
|
@ -187,7 +187,7 @@ public:
|
||||||
va_end(apc);
|
va_end(apc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (severity == FatalError)
|
if (severity == Fatal)
|
||||||
abort();
|
abort();
|
||||||
else if (severity == Error)
|
else if (severity == Error)
|
||||||
++ErrorCount;
|
++ErrorCount;
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
void LogVisorBp() {}
|
void LogVisorBp() {}
|
||||||
|
|
||||||
namespace LogVisor
|
namespace logvisor
|
||||||
{
|
{
|
||||||
|
|
||||||
static std::unordered_map<std::thread::id, const char*> ThreadMap;
|
static std::unordered_map<std::thread::id, const char*> ThreadMap;
|
||||||
|
@ -157,7 +157,7 @@ struct ConsoleLogger : public ILogger
|
||||||
case Error:
|
case Error:
|
||||||
fprintf(stderr, RED BOLD "ERROR");
|
fprintf(stderr, RED BOLD "ERROR");
|
||||||
break;
|
break;
|
||||||
case FatalError:
|
case Fatal:
|
||||||
fprintf(stderr, BOLD RED "FATAL ERROR");
|
fprintf(stderr, BOLD RED "FATAL ERROR");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -229,7 +229,7 @@ struct ConsoleLogger : public ILogger
|
||||||
case Error:
|
case Error:
|
||||||
fprintf(stderr, "ERROR");
|
fprintf(stderr, "ERROR");
|
||||||
break;
|
break;
|
||||||
case FatalError:
|
case Fatal:
|
||||||
fprintf(stderr, "FATAL ERROR");
|
fprintf(stderr, "FATAL ERROR");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -347,7 +347,7 @@ struct FileLogger : public ILogger
|
||||||
case Error:
|
case Error:
|
||||||
fprintf(fp, "ERROR");
|
fprintf(fp, "ERROR");
|
||||||
break;
|
break;
|
||||||
case FatalError:
|
case Fatal:
|
||||||
fprintf(fp, "FATAL ERROR");
|
fprintf(fp, "FATAL ERROR");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue