mirror of
https://github.com/thewesker/RASCSI.git
synced 2025-12-23 13:51:09 -05:00
First draft of nuvolink simulation
This commit is contained in:
@@ -12,11 +12,70 @@
|
||||
#if !defined(log_h)
|
||||
#define log_h
|
||||
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "spdlog/sinks/sink.h"
|
||||
|
||||
#define SPDLOGWRAPPER(loglevel, ...)\
|
||||
do{ char buf[256]; \
|
||||
snprintf(buf, sizeof(buf),__VA_ARGS__); \
|
||||
spdlog::log(loglevel,buf);}while(0);
|
||||
|
||||
#ifdef NDEBUG
|
||||
// If we're doing a non-debug build, we want to skip the overhead of
|
||||
// formatting the string, then calling the logger
|
||||
#define LOGTRACE(...) ((void)0)
|
||||
#define LOGDEBUG(...) ((void)0)
|
||||
#else
|
||||
#define LOGTRACE(...) SPDLOGWRAPPER(spdlog::level::trace, __VA_ARGS__)
|
||||
#define LOGDEBUG(...) SPDLOGWRAPPER(spdlog::level::debug, __VA_ARGS__)
|
||||
#endif
|
||||
#define LOGINFO(...) SPDLOGWRAPPER(spdlog::level::info, __VA_ARGS__)
|
||||
#define LOGWARN(...) SPDLOGWRAPPER(spdlog::level::warn, __VA_ARGS__)
|
||||
#define LOGERROR(...) SPDLOGWRAPPER(spdlog::level::err, __VA_ARGS__)
|
||||
#define LOGCRITICAL(...) SPDLOGWRAPPER(spdlog::level::critical, __VA_ARGS__)
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
#define LOGERR(...) \
|
||||
if(should_log(spdlog::level::err)){\
|
||||
char buf[256]; \
|
||||
snprintf(buf, sizeof(buf),__VA_ARGS__); \
|
||||
spdlog::err(buf);}
|
||||
|
||||
#define LOGWARN(...) \
|
||||
if(should_log(spdlog::level::warn)){\
|
||||
char buf[256]; \
|
||||
snprintf(buf, sizeof(buf),__VA_ARGS__); \
|
||||
spdlog::warn(buf);}
|
||||
|
||||
#define LOGDEBUG(...) \
|
||||
if(should_log(spdlog::level::debug)){\
|
||||
char buf[256]; \
|
||||
snprintf(buf, sizeof(buf),__VA_ARGS__); \
|
||||
spdlog::debug(buf);}
|
||||
|
||||
|
||||
#define LOGINFO(...) \
|
||||
do{char buf[256]; snprintf(buf, 256,__VA_ARGS__); spdlog::info(buf);}while(0)
|
||||
#define LOGTRACE(...) \
|
||||
do{char buf[256]; snprintf(buf, 256,__VA_ARGS__); spdlog::trace(buf);}while(0)
|
||||
if(should_log(spdlog::level::trace)){\
|
||||
char buf[256]; \
|
||||
snprintf(buf, sizeof(buf),__VA_ARGS__); \
|
||||
spdlog::trace(buf);}
|
||||
|
||||
#define LOGERR(...) \
|
||||
do{char buf[256]; snprintf(buf, sizeof(buf),__VA_ARGS__); spdlog::error(buf);}while(0)
|
||||
#define LOGWARN(...) \
|
||||
do{char buf[256]; snprintf(buf, sizeof(buf),__VA_ARGS__); spdlog::warn(buf);}while(0)
|
||||
#define LOGINFO(...) \
|
||||
do{char buf[256]; snprintf(buf, sizeof(buf),__VA_ARGS__); spdlog::info(buf);}while(0)
|
||||
#define LOGDEBUG(...) \
|
||||
do{char buf[256]; snprintf(buf, sizeof(buf),__VA_ARGS__); spdlog::debug(buf);}while(0)
|
||||
#define LOGTRACE(...) \
|
||||
do{char buf[256]; char buf2[512]; snprintf(buf, sizeof(buf),__VA_ARGS__);\
|
||||
snprintf(buf2,sizeof(buf2),)
|
||||
spdlog::trace(buf);}while(0)
|
||||
*/
|
||||
|
||||
|
||||
//===========================================================================
|
||||
|
||||
Reference in New Issue
Block a user