Repository navigation
include global variable in formatter string #902
Unanswered
eastwindow
asked this question in
Q&A
Replies: 1 comment
|
Hey Short answer: No, Two practical options:
thread_local int g_ctx = 42;
LOG_INFO(logger, "message ctx={}", g_ctx);If you want it everywhere, wrap the log macros (e.g., e.g. #define LOG_INFO_CTX(logger, fmt, ...) \
LOG_INFO(logger, "[ctx={}] " fmt, g_ctx, ##__VA_ARGS__)
So: no direct |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is there a way to pull a global (integer) variabale into PatternFormatterOption, or any other way I could print a (const) global (thread_local) variable?
Thanks.
All reactions