30 #ifndef SEABREEZE_LOG_H 31 #define SEABREEZE_LOG_H 41 #define OOI_LOG_PRINT 1 43 #define OOI_LOG_PRINT 0 52 #define LOG(s) Log logger(s); 59 #define LOG_DEBUG(s) do { if (OOI_LOG_PRINT) logger.debug s; } while (0) 62 #define LOG_INFO(s) do { if (OOI_LOG_PRINT) logger.info s; } while (0) 65 #define LOG_WARN(s) do { if (OOI_LOG_PRINT) logger.warn s; } while (0) 68 #define LOG_ERROR(s) do { if (OOI_LOG_PRINT) logger.error s; } while (0) 70 #define OOI_LOG_LEVEL_NEVER 0 71 #define OOI_LOG_LEVEL_ERROR 1 72 #define OOI_LOG_LEVEL_WARN 2 73 #define OOI_LOG_LEVEL_INFO 3 74 #define OOI_LOG_LEVEL_DEBUG 4 75 #define OOI_LOG_LEVEL_TRACE 5 92 static void setLogLevel(
int lvl);
93 static void setLogLevel(
const std::string& s);
94 static void setLogFile(
void *f);
97 void debug(
const char *fmt, ...);
98 void info (
const char *fmt, ...);
99 void warn (
const char *fmt, ...);
100 void error(
const char *fmt, ...);
103 static unsigned logLevel;
104 void formatAndSend(
int lvl,
const char *lvlName,
105 const char *separator,
const char *fmt, va_list args);
109 static FILE *logFile;
110 static std::stack<std::string>* callstack;
113 void trace(
const char *fmt, ...);
121 void DLL_DECL seabreeze_log_set_level_int(
int lvl);
122 void DLL_DECL seabreeze_log_set_level_string(
const char *s);
123 void DLL_DECL seabreeze_log_debug(
const char *fmt, ...);
124 void DLL_DECL seabreeze_log_info (
const char *fmt, ...);
125 void DLL_DECL seabreeze_log_warn (
const char *fmt, ...);
126 void DLL_DECL seabreeze_log_error(
const char *fmt, ...);
Simple logger for OOI applications.
Definition: Log.h:85