wip: drop the file and keep the early-init logging
This commit is contained in:
parent
b983b25405
commit
3b1a1e3c12
|
@ -57,12 +57,6 @@ async fn workflow_finish(
|
|||
}
|
||||
}
|
||||
|
||||
// NOTE(cole-h): see `init_logging`
|
||||
let logfile = std::env::temp_dir().join("magic-nix-cache-tracing.log");
|
||||
let logfile_contents = std::fs::read_to_string(logfile)?;
|
||||
println!("Every log line throughout the lifetime of the program:");
|
||||
println!("\n{logfile_contents}\n");
|
||||
|
||||
let reply = WorkflowFinishResponse {};
|
||||
|
||||
//state.metrics.num_new_paths.set(num_new_paths);
|
||||
|
|
|
@ -447,7 +447,7 @@ async fn main() -> Result<()> {
|
|||
}
|
||||
}
|
||||
|
||||
fn init_logging() -> Result<tracing_appender::non_blocking::WorkerGuard> {
|
||||
fn init_logging() -> Result<()> {
|
||||
let filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| {
|
||||
#[cfg(debug_assertions)]
|
||||
return EnvFilter::new("info")
|
||||
|
@ -462,23 +462,12 @@ fn init_logging() -> Result<tracing_appender::non_blocking::WorkerGuard> {
|
|||
.with_writer(std::io::stderr)
|
||||
.pretty();
|
||||
|
||||
let logfile = std::env::temp_dir().join("magic-nix-cache-tracing.log");
|
||||
let file = std::fs::OpenOptions::new()
|
||||
.create(true)
|
||||
.append(true)
|
||||
.open(logfile)?;
|
||||
let (nonblocking, guard) = tracing_appender::non_blocking(file);
|
||||
let file_layer = tracing_subscriber::fmt::layer()
|
||||
.with_writer(nonblocking)
|
||||
.pretty();
|
||||
|
||||
tracing_subscriber::registry()
|
||||
.with(filter)
|
||||
.with(stderr_layer)
|
||||
.with(file_layer)
|
||||
.init();
|
||||
|
||||
Ok(guard)
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
|
|
Loading…
Reference in a new issue