diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-05-26 22:38:04 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-05-26 22:38:04 +0200 |
commit | b8a87223bb70fccc47ba0f9c96b3f58de6e1e5bd (patch) | |
tree | 212ad4e788509f9e3c6b2bc41120c8687298dcb4 /asl/logging/logging.hpp | |
parent | a1db1cd9e22e77041d5f1360f1d1ccdc52b86306 (diff) |
Diffstat (limited to 'asl/logging/logging.hpp')
-rw-r--r-- | asl/logging/logging.hpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/asl/logging/logging.hpp b/asl/logging/logging.hpp index 9774927..6b8192b 100644 --- a/asl/logging/logging.hpp +++ b/asl/logging/logging.hpp @@ -87,9 +87,26 @@ void log(level l, const source_location& sl, string_view fmt, const Args&... arg } // namespace asl::log -// @Todo Compile-time configuration of logging - -#define ASL_LOG_DEBUG(...) ::asl::log::log(::asl::log::kDebug, ::asl::source_location{}, __VA_ARGS__) -#define ASL_LOG_INFO(...) ::asl::log::log(::asl::log::kInfo, ::asl::source_location{}, __VA_ARGS__) -#define ASL_LOG_WARNING(...) ::asl::log::log(::asl::log::kWarning, ::asl::source_location{}, __VA_ARGS__) -#define ASL_LOG_ERROR(...) ::asl::log::log(::asl::log::kError, ::asl::source_location{}, __VA_ARGS__) +#if !defined(ASL_LOG_LEVEL) || ASL_LOG_LEVEL >= 4 + #define ASL_LOG_DEBUG(...) ::asl::log::log(::asl::log::kDebug, ::asl::source_location{}, __VA_ARGS__) +#else + #define ASL_LOG_DEBUG(...) +#endif + +#if !defined(ASL_LOG_LEVEL) || ASL_LOG_LEVEL >= 3 + #define ASL_LOG_INFO(...) ::asl::log::log(::asl::log::kInfo, ::asl::source_location{}, __VA_ARGS__) +#else + #define ASL_LOG_DEBUG(...) +#endif + +#if !defined(ASL_LOG_LEVEL) || ASL_LOG_LEVEL >= 2 + #define ASL_LOG_WARNING(...) ::asl::log::log(::asl::log::kWarning, ::asl::source_location{}, __VA_ARGS__) +#else + #define ASL_LOG_DEBUG(...) +#endif + +#if !defined(ASL_LOG_LEVEL) || ASL_LOG_LEVEL >= 1 + #define ASL_LOG_ERROR(...) ::asl::log::log(::asl::log::kError, ::asl::source_location{}, __VA_ARGS__) +#else + #define ASL_LOG_DEBUG(...) +#endif |