From: Igor Kulaychuk/AI Ecosystem Lab /SRR/Engineer/삼성전자 Date: Mon, 19 Nov 2018 12:07:17 +0000 (+0300) Subject: Fix filename extraction in logs X-Git-Tag: submit/tizen/20181205.102314~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7a51df874cc656a0dcc7fd0359c6520eba10854;p=sdk%2Ftools%2Fnetcoredbg.git Fix filename extraction in logs --- diff --git a/src/debug/netcoredbg/logger.h b/src/debug/netcoredbg/logger.h index e6826d4..e6d1659 100644 --- a/src/debug/netcoredbg/logger.h +++ b/src/debug/netcoredbg/logger.h @@ -66,15 +66,21 @@ class Logger #ifdef WIN32 #define __CROSS_FUNCTION__ __FUNCSIG__ +#ifndef DIRECTORY_SEPARATOR_STR_A +#define DIRECTORY_SEPARATOR_STR_A "\\" +#endif #else // WIN32 #define __CROSS_FUNCTION__ __PRETTY_FUNCTION__ +#ifndef DIRECTORY_SEPARATOR_STR_A +#define DIRECTORY_SEPARATOR_STR_A "/" +#endif #endif // WIN32 #define LogFuncEntry() \ FuncLogger __funcLogger__ = Logger::getFuncLogger(std::string(__CROSS_FUNCTION__)); -#define __FILENAME__ (strrchr(__FILE__, DIRECTORY_SEPARATOR_STR_A[0]) ? strrchr(__FILE__, DIRECTORY_SEPARATOR_STR_A[0]) + 1 : __FILE__) +#define __FILENAME__ (strrchr(DIRECTORY_SEPARATOR_STR_A __FILE__, DIRECTORY_SEPARATOR_STR_A[0]) + 1) #define LogWithLine(fmt, ...) \ Logger::log("[" + std::string(__FILENAME__) + ":" + std::to_string(__LINE__) + "] " + fmt, ##__VA_ARGS__);