class Redata::Log

Public Class Methods

action(msg) click to toggle source
# File lib/redata/log.rb, line 14
def self.action(msg)
        puts msg.cyan
        self.file msg
end
err_file(msg) click to toggle source
# File lib/redata/log.rb, line 24
def self.err_file(msg)
        File.open RED.log_file, 'a' do |f|
                f.puts msg
        end
end
error!(msg) click to toggle source
# File lib/redata/log.rb, line 3
def self.error!(msg)
        puts msg.red
        self.file msg
        exit 1
end
file(msg) click to toggle source
# File lib/redata/log.rb, line 30
def self.file(msg)
        File.open RED.log_file, 'a' do |f|
                f.puts "[#{RED.current_time}] #{msg}"
        end
end
log(msg) click to toggle source
# File lib/redata/log.rb, line 19
def self.log(msg)
        puts msg
        self.file msg
end
warning(msg) click to toggle source
# File lib/redata/log.rb, line 9
def self.warning(msg)
        puts msg.yellow
        self.file msg
end