diff --git a/core/samples/tel/tracing/main.cpp b/core/samples/tel/tracing/main.cpp index 9d842c85a..b19c95cda 100644 --- a/core/samples/tel/tracing/main.cpp +++ b/core/samples/tel/tracing/main.cpp @@ -1,32 +1,37 @@ /// [Logging and tracing include] +#include #include #include +using cubos::core::tel::Level; +using cubos::core::tel::Logger; using cubos::core::tel::SpanManager; /// [Logging and tracing include] int main() { - cubos::core::tel::Logger::level(cubos::core::tel::Logger::Level::Trace); + cubos::core::tel::level(Level::Debug); /// [Using macros] + CUBOS_SPAN_TRACE("this_wont_exist!"); + + CUBOS_INFO("hello from root span!"); // root span + CUBOS_SPAN_INFO("main_span"); // With this macro, a new RAII guard is created. When dropped, exits the span. // This indicates that we are in the span for the current lexical scope. // Logs and metrics from here will be associated with 'main' span. CUBOS_INFO("hello!"); - CUBOS_SPAN_TRACE("other_scope"); + CUBOS_SPAN_DEBUG("other_scope"); CUBOS_INFO("hello again!"); // ... - /// [Using macros] /// [Manually] - SpanManager::Span span("manual_span", CUBOS_SPAN_LEVEL_DEBUG, __FILE__, __LINE__); - SpanManager::enter(&span); + SpanManager::begin("manual_span", cubos::core::tel::Level::Debug); CUBOS_INFO("entered a manual span"); - SpanManager::exit(); + SpanManager::end(); CUBOS_INFO("after exit manual span"); /// [Manually] -} +} \ No newline at end of file