From d06259f348ae54c1a66615d26a90fa1b1391874d Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 1 Mar 2021 13:22:26 +0100 Subject: [PATCH] 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 --- CommonLibs/Logger.h | 10 +++++----- CommonLibs/debug.h | 7 +------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CommonLibs/Logger.h b/CommonLibs/Logger.h index b752e51a..6452e251 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 ddb5c750..71f344ee 100644 --- a/CommonLibs/debug.h +++ b/CommonLibs/debug.h @@ -3,7 +3,6 @@ #include #include -#include 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)