diff --git a/projects/clr/rocclr/utils/debug.cpp b/projects/clr/rocclr/utils/debug.cpp index 235152085d..e0eb983ec1 100644 --- a/projects/clr/rocclr/utils/debug.cpp +++ b/projects/clr/rocclr/utils/debug.cpp @@ -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 diff --git a/projects/clr/rocclr/utils/debug.hpp b/projects/clr/rocclr/utils/debug.hpp index eacb0bbc68..2cc0d3b85f 100644 --- a/projects/clr/rocclr/utils/debug.hpp +++ b/projects/clr/rocclr/utils/debug.hpp @@ -23,7 +23,7 @@ #include - +#include //! \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__); \ } \