11#pragma once
22
3+ #include < log/env.hpp>
34#include < log/level.hpp>
5+ #include < log/module.hpp>
46#include < sc/format.hpp>
57#include < sc/fwd.hpp>
68
@@ -44,37 +46,18 @@ ALWAYS_INLINE constexpr static auto get_config() -> auto & {
4446 }
4547}
4648
47- template <typename Flavor, level L, typename ModuleId , typename ... Ts,
49+ template <typename Flavor, level L, typename Env , typename ... Ts,
4850 typename ... TArgs>
4951ALWAYS_INLINE static auto log (TArgs &&...args) -> void {
5052 auto &cfg = get_config<Flavor, Ts...>();
51- cfg.logger .template log <L, ModuleId >(std::forward<TArgs>(args)...);
53+ cfg.logger .template log <L, Env >(std::forward<TArgs>(args)...);
5254}
53-
54- template <stdx::ct_string S> struct module_id_t {
55- using type = decltype (stdx::ct_string_to_type<S, sc::string_constant>());
56- };
5755} // namespace logging
5856
59- using cib_log_module_id_t = typename logging::module_id_t <" default" >::type;
60-
6157// NOLINTBEGIN(cppcoreguidelines-macro-usage)
6258
63- #ifdef __clang__
64- #define CIB_PRAGMA_SEMI
65- #else
66- #define CIB_PRAGMA_SEMI ;
67- #endif
68-
69- #define CIB_LOG_MODULE (S ) \
70- STDX_PRAGMA (diagnostic push) \
71- STDX_PRAGMA(diagnostic ignored " -Wshadow" ) \
72- using cib_log_module_id_t [[maybe_unused]] = \
73- typename logging::module_id_t<S>::type CIB_PRAGMA_SEMI STDX_PRAGMA( \
74- diagnostic pop)
75-
7659#define CIB_LOG (FLAVOR, LEVEL, MSG, ...) \
77- logging::log<FLAVOR, LEVEL, cib_log_module_id_t >( \
60+ logging::log<FLAVOR, LEVEL, cib_log_env_t >( \
7861 __FILE__, __LINE__, sc::format(MSG##_sc __VA_OPT__ (, ) __VA_ARGS__))
7962
8063#define CIB_TRACE (...) \
@@ -90,7 +73,7 @@ using cib_log_module_id_t = typename logging::module_id_t<"default">::type;
9073 [] { \
9174 constexpr auto str = sc::format (MSG##_sc __VA_OPT__ (, ) __VA_ARGS__); \
9275 logging::log<logging::default_flavor_t , logging::level::FATAL, \
93- cib_log_module_id_t >(__FILE__, __LINE__, str); \
76+ cib_log_env_t >(__FILE__, __LINE__, str); \
9477 str.apply ([]<typename S, typename ... Args>(S s, Args... args) { \
9578 constexpr auto cts = stdx::ct_string_from_type (s); \
9679 stdx::panic<cts>(args...); \
@@ -111,7 +94,7 @@ ALWAYS_INLINE static auto log_version() -> void {
11194 }) {
11295 l_cfg.logger .template log_build <v_cfg.build_id , v_cfg.version_string >();
11396 } else {
114- l_cfg.logger .template log <level::MAX, cib_log_module_id_t >(
97+ l_cfg.logger .template log <level::MAX, cib_log_env_t >(
11598 " " , 0 ,
11699 sc::format (" Version: {} ({})" _sc, sc::uint_<v_cfg.build_id >,
117100 stdx::ct_string_to_type<v_cfg.version_string ,
0 commit comments