Skip to content
Snippets Groups Projects
Commit 301e8459 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #17351: logger: add pthread_self() output to logs

parent 9f8be04d
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@
#define LOGGER_H_
#include <syslog.h>
#include <pthread.h>
namespace Logger {
void log(const int, const char*, ...);
......@@ -41,8 +42,8 @@ void setDebugMode(bool);
bool getDebugMode();
};
#define LOGGER(M, LEVEL, ...) Logger::log(LEVEL, "%s:%d: " M, __FILE__, \
__LINE__, ##__VA_ARGS__)
#define LOGGER(M, LEVEL, ...) Logger::log(LEVEL, "%s:%d:tid %llu:\t" M, __FILE__, \
__LINE__, pthread_self() & 0xffff, ##__VA_ARGS__)
#define ERROR(M, ...) LOGGER(M, LOG_ERR, ##__VA_ARGS__)
#define WARN(M, ...) LOGGER(M, LOG_WARNING, ##__VA_ARGS__)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment