-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/noterm #91
Feat/noterm #91
Conversation
Added initial support for the log interface (https://doc.rust-lang.org/log/log/index.html)
Hi! Thanks for this! Would you mind fixing up the examples as well? (This is why the tests are failing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple of tiny changes in Cargo.toml
and the README.md
if you don't mind! :)
Then we can publish a new (breaking) version.
description = "Logging middleware for the Iron framework." | ||
repository = "https://github.com/iron/logger" | ||
keywords = ["iron", "web", "logger", "log", "timer"] | ||
license = "MIT" | ||
|
||
[dependencies] | ||
iron = { version = "0.4", default-features = false } | ||
term = "0.4" | ||
log = "*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current version of log is 0.3.6
. We can't use *
specifiers in published crates so this needs to be changed.
- Format strings can specify fields to be logged as well as ANSI terminal colors and attributes. | ||
Logger prints request and response information to the configured log, using either a default format or a custom format string. | ||
|
||
Format strings can specify fields to be logged (ANSI terminal colors and attributes is no longer supported). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be great if we could attach a reason link if we're actually going to say that. Otherwise I'd just leave it out.
Eg.
Format strings can specify fields to be logged (ANSI terminal colors and attributes is no longer supported since #82.)
Some(c) => { try!(self.term.fg(c)); } | ||
None => {}, | ||
let lg = format.iter().map(|unit| render(&unit.text)).collect::<Vec<String>>().join(""); | ||
info!("{}", lg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, glad to see the use of log
. :)
This PR relates to, and closes, #82. |
Thanks! Looks great! =D |
Thanks for reviewing and merging, we should update documentation to indicate that some log implementation is required (and point to some). |
Can you open a new issue for that? :) |
Remove support for logging to terminal, as well as using color and text attributes,
relying simply on log module to deliver the message. I've tested it with stdio_logger create.
This is based on Alexander Irbis fork.