diff --git a/external/oxen-logging b/external/oxen-logging index 0fc1b3528..9d65a01ca 160000 --- a/external/oxen-logging +++ b/external/oxen-logging @@ -1 +1 @@ -Subproject commit 0fc1b3528a52475c4007d734a7861faa2212fe75 +Subproject commit 9d65a01ca73a944cd22e3a2966da2eaa76296456 diff --git a/llarp/util/logging.hpp b/llarp/util/logging.hpp index d549dcb8c..7d1407390 100644 --- a/llarp/util/logging.hpp +++ b/llarp/util/logging.hpp @@ -42,47 +42,72 @@ namespace llarp return std::string_view{ concat_args_fmt_impl>::format.data(), 2 * N}; } - - template - struct LegacyLeveledLogger : log::detail::LeveledLogger - { - LegacyLeveledLogger( - T&&... args, const slns::source_location& location = slns::source_location::current()) - : log::detail::LeveledLogger::LeveledLogger{ - legacy_logger, concat_args_fmt(), std::forward(args)..., location} - {} - }; } // namespace log_detail template - struct LOKINET_LOG_DEPRECATED(Trace) LogTrace - : log_detail::LegacyLeveledLogger + struct LOKINET_LOG_DEPRECATED(Trace) LogTrace : log::trace { - using log_detail::LegacyLeveledLogger::LegacyLeveledLogger; + LogTrace( + T&&... args, + const log::slns::source_location& location = log::slns::source_location::current()) + : log::trace::trace{ + log_detail::legacy_logger, + log_detail::concat_args_fmt(), + std::forward(args)..., + location} + {} }; template - struct LOKINET_LOG_DEPRECATED(Debug) LogDebug - : log_detail::LegacyLeveledLogger + struct LOKINET_LOG_DEPRECATED(Debug) LogDebug : log::debug { - using log_detail::LegacyLeveledLogger::LegacyLeveledLogger; + LogDebug( + T&&... args, + const log::slns::source_location& location = log::slns::source_location::current()) + : log::debug::debug{ + log_detail::legacy_logger, + log_detail::concat_args_fmt(), + std::forward(args)..., + location} + {} }; template - struct LOKINET_LOG_DEPRECATED(Info) LogInfo - : log_detail::LegacyLeveledLogger + struct LOKINET_LOG_DEPRECATED(Info) LogInfo : log::info { - using log_detail::LegacyLeveledLogger::LegacyLeveledLogger; + LogInfo( + T&&... args, + const log::slns::source_location& location = log::slns::source_location::current()) + : log::info::info{ + log_detail::legacy_logger, + log_detail::concat_args_fmt(), + std::forward(args)..., + location} + {} }; template - struct LOKINET_LOG_DEPRECATED(Warning) LogWarn - : log_detail::LegacyLeveledLogger + struct LOKINET_LOG_DEPRECATED(Warning) LogWarn : log::warning { - using log_detail::LegacyLeveledLogger::LegacyLeveledLogger; + LogWarn( + T&&... args, + const log::slns::source_location& location = log::slns::source_location::current()) + : log::warning::warning{ + log_detail::legacy_logger, + log_detail::concat_args_fmt(), + std::forward(args)..., + location} + {} }; template - struct LOKINET_LOG_DEPRECATED(Error) LogError - : log_detail::LegacyLeveledLogger + struct LOKINET_LOG_DEPRECATED(Error) LogError : log::error { - using log_detail::LegacyLeveledLogger::LegacyLeveledLogger; + LogError( + T&&... args, + const log::slns::source_location& location = log::slns::source_location::current()) + : log::error::error{ + log_detail::legacy_logger, + log_detail::concat_args_fmt(), + std::forward(args)..., + location} + {} }; template