Skip to content
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

Winston colors don't work with docker #616

Closed
molszanski opened this issue Apr 28, 2015 · 6 comments
Closed

Winston colors don't work with docker #616

molszanski opened this issue Apr 28, 2015 · 6 comments

Comments

@molszanski
Copy link

If you run winston in container (in my case boot2docker OSX), colors get lost.
This doesn't happen with debug npm library e.g.

@indexzero
Copy link
Member

I believe it is because it is not a tty.

@molszanski
Copy link
Author

One can run a container with a -t -> Allocate a *pseudo*-TTY. That may be the issue.

@tarwich
Copy link

tarwich commented May 21, 2015

Having the same frustration running with forever.

# -c Allows me to monitor the logs in terminal, rather than having Forever move them to a file.
forever -vw -c node test.js

Output is not a TTY and this disables the color. I'd like the option to overrule this behavior, but I'm not sure if Winston is the one breaking this, or if it's something directly related to the console.

Also, piping into less -R doesn't show the colors, though I feel it should.

@tarwich
Copy link

tarwich commented May 21, 2015

...and fixed

passing --color=always to my program fixes this issue. The issue is not with Winston, but with Marak/colors.

That being said, Winston could enable the option with

var colors = require("colors");
if(somethingSaysIShouldColor)
    colors.enabled = true;

If I write a program and manually set require("colors").enabled = true, then it enables the colors for my (non-TTY) program, but not for included programs like Winston.

enabled option found here

@amitport
Copy link

amitport commented Jul 6, 2015

thanks @tarwich
👍

@indexzero
Copy link
Member

Fixed in #751. Released in winston@2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants