NewLang Project
Yet another programm language
|
#include <logger.h>
Public Types | |
typedef uint8_t | LogLevelType |
typedef void | FuncCallback(void *param, LogLevelType level, const char *str, bool flush) |
Public Member Functions | |
LogLevelType | GetLogLevel () |
LogLevelType | GetLogLevelNormal () |
LogLevelType | SetLogLevel (const LogLevelType level) |
bool | SetPrintCallstack (bool enable) |
bool | GetPrintCallstack () |
void | SetCallback (FuncCallback *func, void *param) |
void | SaveCallback (FuncCallback *&func, void *¶m) |
const char * | AddString (LogLevelType level, char const *string, bool flush) |
Logger () | |
Logger (const Logger &)=delete | |
const Logger & | operator= (const Logger &)=delete |
virtual | ~Logger () |
Static Public Member Functions | |
static std::string | GetStackTrace () |
static void | PrintfCallback (void *, LogLevelType, const char *str, bool flush) |
static std::string | log_printf (uint8_t level, char const *prefix, char const *file, int line, char const *format,...) |
static const char * | GetLogLevelDesc (LogLevelType level) |
static Logger * | Instance () |
Public Attributes | |
LogLevelType | m_level |
FuncCallback * | m_func |
void * | m_func_param |
bool | m_print_callstack |
Static Public Attributes | |
static Logger * | m_instance = nullptr |
typedef uint8_t newlang::Logger::LogLevelType |
typedef void newlang::Logger::FuncCallback(void *param, LogLevelType level, const char *str, bool flush) |
|
inline |
Definition at line 386 of file logger.h.
References LOG_LEVEL_NORMAL, m_func, m_func_param, m_level, m_print_callstack, and PrintfCallback().
Referenced by Instance().
|
delete |
|
inline |
Definition at line 322 of file logger.h.
References m_level.
Referenced by log_printf(), newlang::Parser::PragmaEval(), and newlang::NLC::Run().
|
inline |
Definition at line 326 of file logger.h.
References LOG_LEVEL_NORMAL.
|
inline |
Definition at line 330 of file logger.h.
References LOG_LEVEL_ABORT, LOG_LEVEL_MAX, LOG_LEVEL_NORMAL, and m_level.
Referenced by newlang::Parser::PragmaEval().
|
inline |
Definition at line 340 of file logger.h.
References m_print_callstack.
|
inline |
Definition at line 346 of file logger.h.
References m_print_callstack.
|
static |
|
inlinestatic |
|
inline |
Definition at line 358 of file logger.h.
References m_func, and m_func_param.
Referenced by newlang::NLC::Run(), and newlang::NLC::~NLC().
|
inline |
Definition at line 363 of file logger.h.
References m_func, and m_func_param.
Referenced by newlang::NLC::Run().
|
static |
Definition at line 33 of file logger.cpp.
References GetLogLevel(), Instance(), LOG_LEVEL_DUMP, LOG_LEVEL_INFO, m_func, m_func_param, result, and VERIFY.
const char * newlang::Logger::AddString | ( | LogLevelType | level, |
char const * | string, | ||
bool | flush ) |
|
static |
Definition at line 11 of file logger.cpp.
References LOG_LEVEL_ABORT, LOG_LEVEL_DEBUG, LOG_LEVEL_DEFAULT, LOG_LEVEL_DUMP, LOG_LEVEL_ERROR, LOG_LEVEL_FAULT, LOG_LEVEL_INFO, and LOG_LEVEL_WARNING.
|
inlinestatic |
Definition at line 377 of file logger.h.
References Logger(), and m_instance.
Referenced by log_printf(), nlc_prinft_sub_(), newlang::Parser::PragmaEval(), newlang::NLC::Run(), and newlang::NLC::~NLC().
|
static |
Definition at line 397 of file logger.h.
Referenced by Instance().
LogLevelType newlang::Logger::m_level |
Definition at line 398 of file logger.h.
Referenced by GetLogLevel(), Logger(), and SetLogLevel().
FuncCallback* newlang::Logger::m_func |
Definition at line 399 of file logger.h.
Referenced by log_printf(), Logger(), nlc_prinft_sub_(), SaveCallback(), and SetCallback().
void* newlang::Logger::m_func_param |
Definition at line 400 of file logger.h.
Referenced by log_printf(), Logger(), nlc_prinft_sub_(), SaveCallback(), and SetCallback().
bool newlang::Logger::m_print_callstack |
Definition at line 401 of file logger.h.
Referenced by GetPrintCallstack(), Logger(), and SetPrintCallstack().