Initial Commit
This commit is contained in:
commit
c13016275b
41 changed files with 3596 additions and 0 deletions
36
headers/VUtils/Logging.h
Normal file
36
headers/VUtils/Logging.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <VUtils/FileHandler.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DEBUGLOG(message, mod) { Logging::debugMod(message, mod); }
|
||||
#define DBG(...) { Logging::debug(true,__FILE__, __FUNCTION__, __VA_ARGS__); }
|
||||
#define DBGWN(...) { Logging::debug(false,__FILE__, __FUNCTION__, __VA_ARGS__); }
|
||||
#else
|
||||
#define DEBUGLOG(message, mod)
|
||||
#define DBG(...)
|
||||
#define DBGWN(...)
|
||||
#endif
|
||||
#define ERR(...) { Logging::error(true,__FILE__, __FUNCTION__, __VA_ARGS__); }
|
||||
#define ERRWN(...) { Logging::error(false,__FILE__, __FUNCTION__, __VA_ARGS__); }
|
||||
#define LOG(...) { Logging::log(true,__FILE__, __FUNCTION__, __VA_ARGS__ ); }
|
||||
#define LOGWN(...) { Logging::log(false,__FILE__, __FUNCTION__, __VA_ARGS__ ); }
|
||||
#define WARN(...) { Logging::warn(true, __FILE__, __FUNCTION__, __VA_ARGS__ ); }
|
||||
#define WARNWN(...) { Logging::warn(false, __FILE__, __FUNCTION__, __VA_ARGS__ ); }
|
||||
|
||||
class Logging {
|
||||
public:
|
||||
enum class PrintType {
|
||||
ERROR = 0,
|
||||
LOG = 1,
|
||||
WARN = 2,
|
||||
DBG = 3
|
||||
};
|
||||
static void debug(bool newLine, const char *file, const char *func, ...) noexcept;
|
||||
static void log(bool newLine,const char *file, const char *func, ...) noexcept;
|
||||
static void warn(bool newLine,const char *file, const char *func, ...) noexcept;
|
||||
static void error(bool newLine,const char *file, const char *func, ...) noexcept;
|
||||
static std::string format(bool newLine,PrintType type, const char *log, const char *file, const char *func);
|
||||
static std::string getPrefix(PrintType type, const char *module);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue