Skip to content

Commit

Permalink
test: reproduce the bug
Browse files Browse the repository at this point in the history
OpenTelemetry log error occurred. cannot send message to batch processor as the channel is closed
Error: attempted to set a logger after the logging system was already initialized

Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Oct 25, 2024
1 parent 86c8059 commit f3e80e6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ async fn main() -> anyhow::Result<()> {
let mut manager = Opentelemetry::new();
manager.init_log("example", &args.level, &url)?;

match args.level.as_str() {
"info" => log::info!("{}", args.message),
"debug" => log::debug!("{}", args.message),
_ => anyhow::bail!("level `{}` not found", args.level),
}
drop(manager);

let mut manager = Opentelemetry::new();
manager.init_log("foo", &args.level, &url)?;

match args.level.as_str() {
"info" => log::info!("{}", args.message),
"debug" => log::debug!("{}", args.message),
Expand Down

0 comments on commit f3e80e6

Please sign in to comment.