x-cray/logrus-prefixed-formatter

Option to set/force isTerminal to be true.

bbuck opened this issue · 2 comments

bbuck commented

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

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.

=)