Skip to content

Commit 3733de6

Browse files
committed
Use logging instead of println
The println!() macro just prints to stdout. The log macros may output to any output.
1 parent a0543f4 commit 3733de6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/server/handlers.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl middleware::Handler for ReadHandler {
8989
/// Return the current status JSON.
9090
fn handle(&self, req: &mut Request) -> IronResult<Response> {
9191

92-
println!("{} /{} from {}", req.method, req.url.path[0], req.remote_addr);
92+
info!("{} /{} from {}", req.method, req.url.path[0], req.remote_addr);
9393

9494
// Get response body
9595
let body = self.build_response_json().to_string();
@@ -175,8 +175,8 @@ impl middleware::Handler for UpdateHandler {
175175
/// Update the sensor, return correct status code.
176176
fn handle(&self, req: &mut Request) -> IronResult<Response> {
177177

178-
// TODO: create macro for these println! invocations.
179-
println!("{} /{} from {}", req.method, req.url.path[0], req.remote_addr);
178+
// TODO: create macro for these info! invocations.
179+
info!("{} /{} from {}", req.method, req.url.path[0], req.remote_addr);
180180

181181
// Get sensor name
182182
let sensor_name;

0 commit comments

Comments
 (0)