I use the ruby ββlogger as follows:
$logger = Logger.new MultiIO.new($stdout, log_file)
Where MultiIO is the class I got from this answer . This works fine, mostly, but I use 'colored' rubygem to get color output on the terminal. Unfortunately, this also ends in the log file, since ANSI escapes the view of [32mPASS[0m or some similar non-printable characters.
What is the best approach to disinfect log lines while preserving colors for tty lines? I am not against Logger or MultiIO monkey patches, but I absolutely do not want two different calls for the log file and the screen.
ruby logging colors ansi-escape
wim
source share