Ogeon / rustful

[OUTDATED] A light HTTP framework for Rust
https://docs.rs/rustful
Apache License 2.0
862 stars 51 forks source link

Add logging tool #7

Closed Ogeon closed 9 years ago

Ogeon commented 9 years ago

I think that it would be good to let the components of a server share a common logging tool/manager to make logging unified and consistent. Writing everything to stdout and piping it somewhere works, but it's not always desired. Adding a logging tool would also make it easy to customize error messages to, for example, automatically include a time stamp or other meta data.

One way of implementing this is to have a Logger trait with all the desired logging methods (error(...), warning(...), note(...)) and let different types implement it, similar to the Router trait. The server instance would keep an item with this trait and let the plugins, handlers and cache use it for logging.

The discussion is moved to #12.