This repository has been archived by the owner. It is now read-only.

ANSI color codes should check for tty first #30

Closed
mperham opened this Issue Oct 15, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@mperham

mperham commented Oct 15, 2012

When using ANSI color codes, the correct thing to do is check if the output device is a tty? because stdout is often redirected to a file. For example:

logger = Logger.new(STDOUT)
logger.use_ansi = STDOUT.tty?

When I enable command logging through Paperclip, syslog fills up with this:

Oct 15 20:26:49 dt3 sidekiq[24443]: #033[32mCommand#033[0m :: file -b --mime :file
@jyurek

This comment has been minimized.

Show comment
Hide comment
@jyurek

jyurek Oct 17, 2012

Contributor

Quite right! I just pushed a fix in f986c81. Thanks for the report!

Contributor

jyurek commented Oct 17, 2012

Quite right! I just pushed a fix in f986c81. Thanks for the report!

@jyurek jyurek closed this Oct 17, 2012

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.