iron / logger

Morgan-inspired request logger middleware for Iron
MIT License
25 stars 37 forks source link

Degrade gracefully when stdout is not a tty #60

Closed adamreeve closed 8 years ago

adamreeve commented 9 years ago

Logger should just log without colouring output when stdout isn't a tty. Somewhat related to issue #5.

adamreeve commented 9 years ago

Oops, just saw this was already reported in #42. Hopefully I'll have some time to try and fix this.

reem commented 9 years ago

@adamreeve Are you interested in doing more substantial work on logger? It is one of the oldest middleware and has mostly just been patched as iron (and rust) have changed significantly. As a result, it could probably use a more complete refactor to use modern best practices and such.

Alternatively, I've been thinking about actually pulling some form of logging system into iron core, just because it really is a fundamental thing you almost always want to do. This would also require a complete refactor, since the nature of logger would change a lot.

adamreeve commented 9 years ago

I've only just started playing with rust, but would be keen to help out a bit with logger.

It does seem like it would be pretty useful to have logging in iron core though. Would that involve any middleware being able to log messages to the iron logger, so this request logger would still exist as a separate thing but just call into the core logger?

reem commented 9 years ago

@adamreeve what API would you imagine for logging in iron core? I have also thought about it before, but I want to avoid being too opinionated.

adamreeve commented 9 years ago

Yeah I think you'd want to keep it pretty generic, it might make a lot of sense to just include a configurable logger that works with the standard log crate. Or have something compatible with the log crate but with some extra iron specific log methods if necessary?

reem commented 8 years ago

This is kind of fixed on master, by just degrading to plaintext.

reem commented 8 years ago

We should discuss other ideas on another issue.