Skip to content

Commit e057519

Browse files
committedOct 12, 2018
Don't always set env-var for logging
1 parent 279b271 commit e057519

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed
 

‎src/lib/presets/m2/handlers/config_post.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ pub fn handle(req: &HttpRequest<AppState>) -> FutResp {
2727
mutex.config = next_config.config;
2828
mutex.paths = next_config.paths;
2929
mutex.shim = next_config.shim;
30-
"Was Good!".to_string()
31-
}
32-
Err(e) => e.to_string(),
33-
};
3430

35-
Ok(HttpResponse::Ok()
36-
.content_type("application/json")
37-
.body("yo!"))
31+
Ok(HttpResponse::Ok()
32+
.content_type("application/json")
33+
.body("ok"))
34+
}
35+
Err(e) => Ok(super::err_response::create(e.to_string())),
36+
}
3837
})
3938
.responder()
4039
}

‎src/lib/presets/m2/preset_m2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl Preset<AppState> for M2Preset {
8080

8181
http_async_responders
8282
.into_iter()
83-
.fold(app, |acc_app, (path, method, handle)| {
83+
.fold(app, |acc_app, (path, _method, handle)| {
8484
acc_app.resource(&path, move |r| r.f(handle))
8585
})
8686
}

‎src/main.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ fn run_with_opts(opts: ProgramOptions) -> Result<(), ProgramStartError> {
3636
//
3737
// Logging config
3838
//
39-
::std::env::set_var("RUST_LOG", "actix_web=info");
4039
env_logger::init();
4140

4241
//
@@ -96,7 +95,7 @@ fn run_with_opts(opts: ProgramOptions) -> Result<(), ProgramStartError> {
9695
.shutdown_timeout(0)
9796
.start();
9897

99-
println!("Started server: {}://{}", server_opts.scheme, local_addr);
98+
println!("{}://{}", server_opts.scheme, local_addr);
10099

101100
let _ = sys.run();
102101

0 commit comments

Comments
 (0)
Please sign in to comment.