Properly removes the colour sequence from log. Fixes #480

This commit is contained in:
erwanlr
2014-05-14 18:33:23 +02:00
parent c1c8829536
commit 79f07b7350

View File

@@ -51,7 +51,7 @@ end
def puts(o = '')
# remove color for logging
if o.respond_to?(:gsub)
temp = o.gsub(/\e\[\d+m(.*)?\e\[0m/, '\1')
temp = o.gsub(/\e\[\d+m/, '')
File.open(LOG_FILE, 'a+') { |f| f.puts(temp) }
end
super(o)