4
4
#include < log/flavor.hpp>
5
5
#include < log/level.hpp>
6
6
#include < log/module.hpp>
7
- #include < sc/format.hpp>
8
- #include < sc/fwd.hpp>
9
7
10
8
#include < stdx/compiler.hpp>
9
+ #include < stdx/ct_format.hpp>
11
10
#include < stdx/ct_string.hpp>
12
11
#include < stdx/panic.hpp>
13
12
#include < stdx/type_traits.hpp>
@@ -58,13 +57,13 @@ static auto log(TArgs &&...args) -> void {
58
57
// NOLINTBEGIN(cppcoreguidelines-macro-usage)
59
58
60
59
#define CIB_LOG (MSG, ...) \
61
- logging::log<cib_log_env_t >( \
62
- __FILE__, __LINE__, sc::format( MSG##_sc __VA_OPT__ (, ) __VA_ARGS__))
60
+ logging::log<cib_log_env_t >(__FILE__, __LINE__, \
61
+ stdx::ct_format< MSG>( __VA_ARGS__))
63
62
64
63
#define CIB_LOG_WITH_LEVEL (LEVEL, MSG, ...) \
65
64
logging::log< \
66
65
stdx::extend_env_t <cib_log_env_t , logging::get_level, LEVEL>>( \
67
- __FILE__, __LINE__, sc::format( MSG##_sc __VA_OPT__ (, ) __VA_ARGS__))
66
+ __FILE__, __LINE__, stdx::ct_format< MSG>( __VA_ARGS__))
68
67
69
68
#define CIB_TRACE (...) \
70
69
CIB_LOG_WITH_LEVEL (logging::level::TRACE __VA_OPT__ (, ) __VA_ARGS__)
@@ -76,14 +75,13 @@ static auto log(TArgs &&...args) -> void {
76
75
CIB_LOG_WITH_LEVEL (logging::level::ERROR __VA_OPT__ (, ) __VA_ARGS__)
77
76
78
77
#define CIB_FATAL (MSG, ...) \
79
- [](auto &&str ) { \
78
+ [](auto &&s ) { \
80
79
CIB_LOG_ENV (logging::get_level, logging::level::FATAL); \
81
- logging::log<cib_log_env_t >(__FILE__, __LINE__, str); \
82
- FWD (str).apply ([]<typename S, typename ... Args>(S s, Args... args) { \
83
- constexpr auto cts = stdx::ct_string_from_type (s); \
84
- stdx::panic<cts>(args...); \
80
+ logging::log<cib_log_env_t >(__FILE__, __LINE__, s); \
81
+ FWD (s).args .apply ([](auto &&...args ) { \
82
+ stdx::panic<decltype (s.str )::value>(FWD (args)...); \
85
83
}); \
86
- }(sc::format( MSG##_sc __VA_OPT__ (, ) __VA_ARGS__))
84
+ }(stdx::ct_format< MSG>( __VA_ARGS__))
87
85
88
86
#define CIB_ASSERT (expr ) \
89
87
((expr) ? void(0 ) : CIB_FATAL(" Assertion failure: " #expr))
@@ -102,9 +100,8 @@ template <typename Env, typename... Ts> static auto log_version() -> void {
102
100
CIB_LOG_ENV (logging::get_level, logging::level::MAX);
103
101
l_cfg.logger .template log <cib_log_env_t >(
104
102
" " , 0 ,
105
- sc::format (" Version: {} ({})" _sc, sc::uint_<v_cfg.build_id >,
106
- stdx::ct_string_to_type<v_cfg.version_string ,
107
- sc::string_constant>()));
103
+ stdx::ct_format<" Version: {} ({})" >(
104
+ CX_VALUE (v_cfg.build_id ), CX_VALUE (v_cfg.version_string )));
108
105
}
109
106
}
110
107
} // namespace logging
0 commit comments