@@ -49,11 +49,13 @@ end
|
||||
|
||||
# Override for puts to enable logging
|
||||
def puts(o = '')
|
||||
# remove color for logging
|
||||
if o.respond_to?(:gsub)
|
||||
temp = o.gsub(/\e\[\d+m/, '')
|
||||
File.open(LOG_FILE, 'a+') { |f| f.puts(temp) }
|
||||
if @log
|
||||
if o.respond_to?(:gsub)
|
||||
temp = o.gsub(/\e\[\d+m/, '') # remove color for logging
|
||||
File.open(LOG_FILE, 'a+') { |f| f.puts(temp) }
|
||||
end
|
||||
end
|
||||
|
||||
super(o)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user