Implement macros that capture current file, line, and function name.
This commit is contained in:
@@ -47,7 +47,6 @@ namespace jlog
|
||||
|
||||
void log(std::vector<token> tokens);
|
||||
|
||||
void direct (const std::string& message);
|
||||
void info (const std::string& message);
|
||||
void verbose(const std::string& message);
|
||||
|
||||
@@ -59,4 +58,21 @@ namespace jlog
|
||||
|
||||
void fatal (const std::string& message);
|
||||
|
||||
}
|
||||
|
||||
void info_spec(const std::string& message, const std::string& func, const std::string& file, int line);
|
||||
void verbose_spec(const std::string& message, const std::string& func, const std::string& file, int line);
|
||||
void debug_spec(const std::string& message, const std::string& func, const std::string& file, int line);
|
||||
void warning_spec(const std::string& message, const std::string& func, const std::string& file, int line);
|
||||
void error_spec(const std::string& message, const std::string& func, const std::string& file, int line);
|
||||
void fatal_spec(const std::string& message, const std::string& func, const std::string& file, int line);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#define INFO(i) jlog::info_spec(i, __PRETTY_FUNCTION__, __FILE__, __LINE__);
|
||||
#define VERBOSE(i) jlog::verbose_spec(i, __PRETTY_FUNCTION__, __FILE__, __LINE__);
|
||||
#define DEBUG(i) jlog::debug_spec(i, __PRETTY_FUNCTION__, __FILE__, __LINE__);
|
||||
#define WARNING(i) jlog::warning_spec(i, __PRETTY_FUNCTION__, __FILE__, __LINE__);
|
||||
#define ERROR(i) jlog::error_spec(i, __PRETTY_FUNCTION__, __FILE__, __LINE__);
|
||||
#define FATAL(i) jlog::fatal_spec(i, __PRETTY_FUNCTION__, __FILE__, __LINE__);
|
||||
|
Reference in New Issue
Block a user