Skip to content

Commit d6df1ac

Browse files
committed
remove log_file leftovers
PR #74 (Log to stderr not to a file) did not remove all references to log_file, the file was still created, but remained empty. The synapse_auto_compressor failed if run in a read only environment. Signed-off-by: saces <[email protected]>
1 parent 32e43da commit d6df1ac

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

synapse_auto_compressor/src/main.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,14 @@ static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
2121

2222
use clap::{crate_authors, crate_description, crate_name, crate_version, value_t, App, Arg};
2323
use log::LevelFilter;
24-
use std::{env, fs::OpenOptions};
24+
use std::env;
2525
use synapse_auto_compressor::{manager, state_saving, LevelInfo};
2626

2727
/// Execution starts here
2828
fn main() {
2929
// setup the logger for the synapse_auto_compressor
3030
// The default can be overwritten with RUST_LOG
3131
// see the README for more information
32-
let log_file = OpenOptions::new()
33-
.append(true)
34-
.create(true)
35-
.open("synapse_auto_compressor.log")
36-
.unwrap_or_else(|e| panic!("Error occured while opening the log file: {}", e));
37-
3832
if env::var("RUST_LOG").is_err() {
3933
let mut log_builder = env_logger::builder();
4034
// Ensure panics still come through
@@ -47,7 +41,6 @@ fn main() {
4741
} else {
4842
// If RUST_LOG was set then use that
4943
let mut log_builder = env_logger::Builder::from_env("RUST_LOG");
50-
log_builder.target(env_logger::Target::Pipe(Box::new(log_file)));
5144
// Ensure panics still come through
5245
log_builder.filter_module("panic", LevelFilter::Error);
5346
log_builder.init();

0 commit comments

Comments
 (0)