Skip to content

Commit

Permalink
Remove runtime from use for log-basic
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan committed Dec 18, 2024
1 parent 8e67614 commit 8d6e116
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions opentelemetry-appender-log/examples/logs-basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use log::{error, info, warn, Level};
use opentelemetry_appender_log::OpenTelemetryLogBridge;
use opentelemetry_sdk::logs::{BatchLogProcessor, LoggerProvider};
use opentelemetry_sdk::runtime;
use opentelemetry_stdout::LogExporter;

#[tokio::main]
Expand All @@ -21,8 +20,7 @@ async fn main() {

// Setup Log Appender for the log crate.
let otel_log_appender = OpenTelemetryLogBridge::new(&logger_provider);
log::set_boxed_logger(Box::new(otel_log_appender)).unwrap();
log::set_max_level(Level::Info.to_level_filter());
log::set_boxed_logger(Box::new(otel_log_appender)).unwrap(); log::set_max_level(Level::Info.to_level_filter());

// Emit logs using macros from the log crate.
let fruit = "apple";
Expand Down

0 comments on commit 8d6e116

Please sign in to comment.