cli: when attaching, always print the connection link (#178445)

Fixes #178090
This commit is contained in:
Connor Peet
2023-03-27 12:52:50 -07:00
committed by GitHub
parent b51e2f3613
commit dfbea0f578
7 changed files with 105 additions and 55 deletions

View File

@@ -10,13 +10,13 @@ use opentelemetry::{
};
use serde::{Deserialize, Serialize};
use std::fmt;
use std::{env, path::Path, sync::Arc};
use std::{
io::Write,
sync::atomic::{AtomicU32, Ordering},
};
use std::{path::Path, sync::Arc};
const NO_COLOR_ENV: &str = "NO_COLOR";
use crate::constants::COLORS_ENABLED;
static INSTANCE_COUNTER: AtomicU32 = AtomicU32::new(0);
@@ -71,7 +71,7 @@ impl Level {
}
pub fn color_code(&self) -> Option<&str> {
if env::var(NO_COLOR_ENV).is_ok() || !atty::is(atty::Stream::Stdout) {
if !*COLORS_ENABLED {
return None;
}