Files
tkmind_go/crates/goose-server/src/logging.rs
T
Rodolfo Olivieri 4de5fcdff8 refactor(logging): consolidate logging setup into shared helper in goose crate (#8817)
Signed-off-by: Rodolfo Olivieri <rolivier@redhat.com>
Signed-off-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
2026-05-13 18:35:41 +00:00

18 lines
573 B
Rust

use anyhow::Result;
use tracing_subscriber::util::SubscriberInitExt;
/// Sets up the logging infrastructure for the server.
/// Logs go to a JSON file and a pretty console layer on stderr.
pub fn setup_logging(name: Option<&str>) -> Result<()> {
let config = goose::logging::LoggingConfig {
component: "server",
name,
extra_directives: &["goose_server=info", "tower_http=info"],
console: true,
json: false,
};
let subscriber = goose::logging::build_logging_subscriber(&config)?;
subscriber.try_init()?;
Ok(())
}