x-cray / logrus-prefixed-formatter

Logrus Prefixed Log Formatter
MIT License
199 stars 107 forks source link

Option to set/force isTerminal to be true. #6

Closed bbuck closed 7 years ago

bbuck commented 7 years ago

I've wrapped the standard os.Stdout/os.Stderr io.Writer options, and also use io.MultiWriter for potentially multiple output targets. I do this because I have a layer of text processing to take place before output hits the terminal. With the latest updates to this library (and logrus) logging is now downgraded because io.Writer is not an *os.File but instead my custom wrapping type. Perhaps this is really an issue with logrus but it seems like it would be nice to force terminal status.

bbuck commented 7 years ago

Disregard.

I posted an issue to add an interface that I can implement to determine if my custom type is a Terminal or not. This is definitely not something this formatter should worry about. Not only that, but my custom type no longer needs to do color processing, I can move that into hooks. But I still use io.MultiWriter and would want to implement (myself) whether or not to report if the multi-writer is a terminal or not.

x-cray commented 7 years ago

=)