removing file path from LOG_LEVEL and adding time stamp

Change-Id: Ia32f21353adad4dcb4928909361fe0420c502c1e


[ROCm/clr commit: 7052e21c87]
This commit is contained in:
Payam
2020-04-04 09:15:43 -04:00
committed by Payam Ghafari
orang tua 8d5b686e8b
melakukan 97f9e8935b
2 mengubah file dengan 5 tambahan dan 3 penghapusan
+1 -1
Melihat File
@@ -88,7 +88,7 @@ void log_printf(LogLevel level, const char* file, int line, const char* format,
vsnprintf(message, sizeof(message), format, ap);
va_end(ap);
fprintf(stderr, ":%d:%s:%d: %s\n", level, file, line, message);
fprintf(stderr, ":%d:%-25s:%-4d: %010lld: %s\n", level, file, line, Os::timeNanos() / 100ULL, message);
}
} // namespace amd
+4 -2
Melihat File
@@ -23,7 +23,7 @@
#include <cassert>
#include <string.h>
//! \addtogroup Utils
namespace amd { /*@{*/
@@ -124,6 +124,8 @@ inline void warning(const char* msg) { amd::report_warning(msg); }
#define Untested(msg) (void)(0)
#endif /*NDEBUG*/
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#define Log(level, msg) \
do { \
if (LOG_LEVEL >= level) { \
@@ -180,7 +182,7 @@ inline void warning(const char* msg) { amd::report_warning(msg); }
if (LOG_LEVEL >= level) { \
if (GPU_LOG_MASK & mask || mask == amd::LOG_ALWAYS) { \
if (GPU_LOG_MASK & amd::LOG_LOCATION) { \
amd::log_printf(level, __FILE__, __LINE__, format, ##__VA_ARGS__); \
amd::log_printf(level, __FILENAME__, __LINE__, format, ##__VA_ARGS__); \
} else { \
amd::log_printf(level, "", 0, format, ##__VA_ARGS__); \
} \