Open bergjohan opened 3 weeks ago
Steps to reproduce Create a severity_logger with the type of boost::log::trivial::severity_level instead of int.
boost::log::trivial::severity_level
int
boost::log::sources::severity_logger<boost::log::trivial::severity_level> logger; BOOST_LOG_SEV(logger, boost::log::trivial::info) << "Test message with severity";
What is the expected behavior?
severity_num : 9 severity_text : INFO body : Test message with severity
What is the actual behavior?
severity_num : 0 severity_text : INVALID body : Test message with severity
Additional context boost::log::extract_or_default fails here, because it expects the type of int: https://github.com/open-telemetry/opentelemetry-cpp-contrib/blob/main/instrumentation/boost_log/src/sink.cc#L71
boost::log::extract_or_default
We are clearly using boost::log::trivial::severity_level by default (https://github.com/open-telemetry/opentelemetry-cpp-contrib/blob/main/instrumentation/boost_log/include/opentelemetry/instrumentation/boost_log/sink.h#L60), so why not use the correct type everywhere?
Steps to reproduce Create a severity_logger with the type of
boost::log::trivial::severity_level
instead ofint
.What is the expected behavior?
What is the actual behavior?
Additional context
boost::log::extract_or_default
fails here, because it expects the type ofint
: https://github.com/open-telemetry/opentelemetry-cpp-contrib/blob/main/instrumentation/boost_log/src/sink.cc#L71We are clearly using
boost::log::trivial::severity_level
by default (https://github.com/open-telemetry/opentelemetry-cpp-contrib/blob/main/instrumentation/boost_log/include/opentelemetry/instrumentation/boost_log/sink.h#L60), so why not use the correct type everywhere?