diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-03-01 13:22:26 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-03-01 16:35:42 +0100 |
commit | d06259f348ae54c1a66615d26a90fa1b1391874d (patch) | |
tree | 490e6b0501378836f3612a884bd25fc7ff06ade9 | |
parent | 6c646c35b9f25f7029835a320553403a694e023b (diff) |
Drop logging pthread ID
new libosmocore osmo-trx already depends on does support printing thread
ID as prefix to all messages (confgiurable through VTY), so there's no
use in printing it in osmo-trx unconditionally.
Moreover, The type used to represent a thread ID is implementation
specific, and may be an opaqe structure, making it unsuitable to be
printed by standard means, so in any case we should be better printing
system's TID instead.
Related: OS#5032
Change-Id: Ie98a21246230c946afc47f4f5b9c6618eefde494
-rw-r--r-- | CommonLibs/Logger.h | 10 | ||||
-rw-r--r-- | CommonLibs/debug.h | 7 |
2 files changed, 6 insertions, 11 deletions
diff --git a/CommonLibs/Logger.h b/CommonLibs/Logger.h index b752e51..6452e25 100644 --- a/CommonLibs/Logger.h +++ b/CommonLibs/Logger.h @@ -50,19 +50,19 @@ extern "C" { #endif #define LOG(level) \ - Log(DMAIN, LOGL_##level, __BASE_FILE__, __LINE__).get() << "[tid=" << pthread_self() << "] " + Log(DMAIN, LOGL_##level, __BASE_FILE__, __LINE__).get() #define LOGC(category, level) \ - Log(category, LOGL_##level, __BASE_FILE__, __LINE__).get() << "[tid=" << pthread_self() << "] " + Log(category, LOGL_##level, __BASE_FILE__, __LINE__).get() #define LOGLV(category, level) \ - Log(category, level, __BASE_FILE__, __LINE__).get() << "[tid=" << pthread_self() << "] " + Log(category, level, __BASE_FILE__, __LINE__).get() #define LOGSRC(category, level, file, line) \ - Log(category, level, file, line).get() << "[tid=" << pthread_self() << "] " + Log(category, level, file, line).get() #define LOGCHAN(chan, category, level) \ - Log(category, LOGL_##level, __BASE_FILE__, __LINE__).get() << "[tid=" << pthread_self() << "][chan=" << chan << "] " + Log(category, LOGL_##level, __BASE_FILE__, __LINE__).get() << "[chan=" << chan << "] " /** A C++ stream-based thread-safe logger. diff --git a/CommonLibs/debug.h b/CommonLibs/debug.h index ddb5c75..71f344e 100644 --- a/CommonLibs/debug.h +++ b/CommonLibs/debug.h @@ -3,7 +3,6 @@ #include <stdbool.h> #include <osmocom/core/logging.h> -#include <osmocom/core/thread.h> extern const struct log_info log_info; @@ -19,10 +18,6 @@ enum { DCTR, }; -#define CLOGC(category, level, fmt, args...) do { \ - LOGP(category, level, "[tid=%ld] " fmt, (long int) osmo_gettid(), ##args); \ -} while(0) - #define CLOGCHAN(chan, category, level, fmt, args...) do { \ - LOGP(category, level, "[tid=%ld][chan=%zu] " fmt, (long int) osmo_gettid(), chan, ##args); \ + LOGP(category, level, "[chan=%zu] " fmt, chan, ##args); \ } while(0) |