Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DebugLogEnable.h #16

Merged
merged 3 commits into from
Oct 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DebugLogEnable.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#define LOG_SHORT_FILENAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)

// C pre-proc Token Concatenation: https://wiki.sei.cmu.edu/confluence/display/c/PRE05-C.+Understand+macro+replacement+when+concatenating+tokens+or+performing+stringification
#define xstr(s) str(s)
#define str(s) #s
#define MACRO_xstr(s) MACRO_str(s)
#define MACRO_str(s) #s

#ifndef LOG_PREAMBLE
#define LOG_PREAMBLE LOG_SHORT_FILENAME, xstr(L.__LINE__), __func__, ":"
#define LOG_PREAMBLE LOG_SHORT_FILENAME, MACRO_xstr(L.__LINE__), __func__, ":"
#endif

#if defined(DEBUGLOG_DEFAULT_LOG_LEVEL_ERROR)
Expand Down