Skip to content

Commit

Permalink
Added shorter log
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Saucedo <[email protected]>
  • Loading branch information
axsaucedo committed Nov 27, 2022
1 parent 206f330 commit 05237ee
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/include/kompute/logger/Logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ setupLogger();
#if KOMPUTE_BUILD_PYTHON
#define KP_LOG_DEBUG(...) kp_debug(fmt::format(__VA_ARGS__))
#else
#ifdef __FILE_NAME__ // gcc 12 provides only file name without path
#define KP_LOG_DEBUG(...) \
fmt::print("[{} {}] [debug] [{}:{}] {}\n", \
__DATE__, \
__TIME__, \
__FILE_NAME__, \
__LINE__, \
fmt::format(__VA_ARGS__))
#else
#define KP_LOG_DEBUG(...) \
fmt::print("[{} {}] [debug] [{}:{}] {}\n", \
__DATE__, \
Expand Down Expand Up @@ -184,4 +193,4 @@ getLogLevel();
#endif // !KOMPUTE_OPT_USE_SPDLOG
} // namespace logger

#endif // KOMPUTE_OPT_LOG_LEVEL_DISABLED
#endif // KOMPUTE_OPT_LOG_LEVEL_DISABLED

0 comments on commit 05237ee

Please sign in to comment.