Skip to content

Commit ada3ff6

Browse files
committed
⚡ Inline injected log functions
1 parent dfe698a commit ada3ff6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/log/log.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <sc/format.hpp>
55
#include <sc/fwd.hpp>
66

7+
#include <stdx/compiler.hpp>
78
#include <stdx/ct_string.hpp>
89
#include <stdx/panic.hpp>
910

@@ -35,7 +36,7 @@ template <typename...> inline auto config = null::config{};
3536
struct default_flavor_t;
3637

3738
template <typename Flavor, typename... Ts>
38-
constexpr static auto get_config() -> auto & {
39+
ALWAYS_INLINE constexpr static auto get_config() -> auto & {
3940
if constexpr (std::same_as<Flavor, default_flavor_t>) {
4041
return config<Ts...>;
4142
} else {
@@ -45,7 +46,7 @@ constexpr static auto get_config() -> auto & {
4546

4647
template <typename Flavor, level L, typename ModuleId, typename... Ts,
4748
typename... TArgs>
48-
static auto log(TArgs &&...args) -> void {
49+
ALWAYS_INLINE static auto log(TArgs &&...args) -> void {
4950
auto &cfg = get_config<Flavor, Ts...>();
5051
cfg.logger.template log<L, ModuleId>(std::forward<TArgs>(args)...);
5152
}
@@ -103,7 +104,8 @@ using cib_log_module_id_t = typename logging::module_id_t<"default">::type;
103104
((expr) ? void(0) : CIB_FATAL("Assertion failure: " #expr))
104105

105106
namespace logging {
106-
template <typename Flavor, typename... Ts> static auto log_version() -> void {
107+
template <typename Flavor, typename... Ts>
108+
ALWAYS_INLINE static auto log_version() -> void {
107109
auto &l_cfg = get_config<Flavor, Ts...>();
108110
auto &v_cfg = ::version::config<Ts...>;
109111
if constexpr (requires {

0 commit comments

Comments
 (0)