strip ansi escapes from systemd-managed daemon logs
This commit is contained in:
parent
b9d315dcd9
commit
5f197a38ee
11 changed files with 44 additions and 0 deletions
|
|
@ -43,6 +43,10 @@ async fn main() -> Result<()> {
|
||||||
tracing_subscriber::EnvFilter::try_from_default_env()
|
tracing_subscriber::EnvFilter::try_from_default_env()
|
||||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
||||||
)
|
)
|
||||||
|
// This is a systemd-managed daemon — stdout always goes to journald,
|
||||||
|
// never a human terminal, and journald doesn't strip ANSI escapes:
|
||||||
|
// they land in victorialogs as raw byte-array spam otherwise.
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,10 @@ async fn main() -> Result<()> {
|
||||||
tracing_subscriber::EnvFilter::try_from_default_env()
|
tracing_subscriber::EnvFilter::try_from_default_env()
|
||||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
||||||
)
|
)
|
||||||
|
// This is a systemd-managed daemon — stdout always goes to journald,
|
||||||
|
// never a human terminal, and journald doesn't strip ANSI escapes:
|
||||||
|
// they land in victorialogs as raw byte-array spam otherwise.
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,10 @@ async fn main() -> Result<()> {
|
||||||
tracing_subscriber::EnvFilter::try_from_env("RUST_LOG")
|
tracing_subscriber::EnvFilter::try_from_env("RUST_LOG")
|
||||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
||||||
)
|
)
|
||||||
|
// This is a systemd-managed daemon — stdout always goes to journald,
|
||||||
|
// never a human terminal, and journald doesn't strip ANSI escapes:
|
||||||
|
// they land in victorialogs as raw byte-array spam otherwise.
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,10 @@ async fn main() -> Result<()> {
|
||||||
tracing_subscriber::EnvFilter::try_from_default_env()
|
tracing_subscriber::EnvFilter::try_from_default_env()
|
||||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
||||||
)
|
)
|
||||||
|
// This is a systemd-managed daemon — stdout always goes to journald,
|
||||||
|
// never a human terminal, and journald doesn't strip ANSI escapes:
|
||||||
|
// they land in victorialogs as raw byte-array spam otherwise.
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,10 @@ pub fn init_tracing() {
|
||||||
tracing_subscriber::EnvFilter::try_from_env("RUST_LOG")
|
tracing_subscriber::EnvFilter::try_from_env("RUST_LOG")
|
||||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
||||||
)
|
)
|
||||||
|
// This is a systemd-managed daemon — stdout always goes to journald,
|
||||||
|
// never a human terminal, and journald doesn't strip ANSI escapes:
|
||||||
|
// they land in victorialogs as raw byte-array spam otherwise.
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,10 @@ async fn main() -> Result<()> {
|
||||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
||||||
)
|
)
|
||||||
.with_writer(std::io::stderr)
|
.with_writer(std::io::stderr)
|
||||||
|
// This is a systemd-managed daemon — stderr always goes to journald,
|
||||||
|
// never a human terminal, and journald doesn't strip ANSI escapes:
|
||||||
|
// they land in victorialogs as raw byte-array spam otherwise.
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,10 @@ async fn main() -> Result<()> {
|
||||||
.with_env_filter(
|
.with_env_filter(
|
||||||
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into()),
|
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into()),
|
||||||
)
|
)
|
||||||
|
// This is a systemd-managed daemon — stdout always goes to journald,
|
||||||
|
// never a human terminal, and journald doesn't strip ANSI escapes:
|
||||||
|
// they land in victorialogs as raw byte-array spam otherwise.
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
let listener = socket_listener()?;
|
let listener = socket_listener()?;
|
||||||
|
|
|
||||||
|
|
@ -348,6 +348,10 @@ async fn main() -> Result<()> {
|
||||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("warn")),
|
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("warn")),
|
||||||
)
|
)
|
||||||
.with_writer(std::io::stderr)
|
.with_writer(std::io::stderr)
|
||||||
|
// This is a systemd-managed daemon — stderr always goes to journald,
|
||||||
|
// never a human terminal, and journald doesn't strip ANSI escapes:
|
||||||
|
// they land in victorialogs as raw byte-array spam otherwise.
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
let service = ScreenMcp.serve(stdio()).await?;
|
let service = ScreenMcp.serve(stdio()).await?;
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,10 @@ async fn main() -> Result<()> {
|
||||||
.with_env_filter(
|
.with_env_filter(
|
||||||
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into()),
|
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into()),
|
||||||
)
|
)
|
||||||
|
// This is a systemd-managed daemon — stdout always goes to journald,
|
||||||
|
// never a human terminal, and journald doesn't strip ANSI escapes:
|
||||||
|
// they land in victorialogs as raw byte-array spam otherwise.
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
let config = Config::from_env()?;
|
let config = Config::from_env()?;
|
||||||
|
|
|
||||||
|
|
@ -1090,6 +1090,10 @@ async fn main() -> Result<()> {
|
||||||
tracing_subscriber::EnvFilter::try_from_default_env()
|
tracing_subscriber::EnvFilter::try_from_default_env()
|
||||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
||||||
)
|
)
|
||||||
|
// This is a systemd-managed daemon — stdout always goes to journald,
|
||||||
|
// never a human terminal, and journald doesn't strip ANSI escapes:
|
||||||
|
// they land in victorialogs as raw byte-array spam otherwise.
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
let path = socket_path();
|
let path = socket_path();
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,10 @@ async fn main() -> anyhow::Result<()> {
|
||||||
tracing_subscriber::EnvFilter::try_from_default_env()
|
tracing_subscriber::EnvFilter::try_from_default_env()
|
||||||
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
|
||||||
)
|
)
|
||||||
|
// This is a systemd-managed daemon — stdout always goes to journald,
|
||||||
|
// never a human terminal, and journald doesn't strip ANSI escapes:
|
||||||
|
// they land in victorialogs as raw byte-array spam otherwise.
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue