Sha256: 58486529f6c26de52da18a9d71d8c00db278f1355983583b5aa9f797ed9805a4
Contents?: true
Size: 754 Bytes
Versions: 3
Compression:
Stored size: 754 Bytes
Contents
module Pakyow # Provides an easy way to log text, warnings, etc. class Log # Adds text to the log. def self.puts(text = "") return if !Configuration::Base.app.log @@console ||= $stdout @@console << "#{text}\r\n" dir = "#{Configuration::Base.app.log_dir}" if File.exists?(dir) @@file ||= File.open("#{dir}/#{Configuration::Base.app.log_name}", 'a') @@file.write "#{text}\r\n" end end class << self alias :enter :puts end # Adds warning text to the log. def self.warn(text) Log.enter("WARNING: #{text}") end # Adds error text to the log. def self.error(text) Log.enter("ERROR: #{text}") end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
pakyow-core-0.7.2 | pakyow-core/lib/core/log.rb |
pakyow-core-0.7.1 | pakyow-core/lib/core/log.rb |
pakyow-core-0.7.0 | pakyow-core/lib/core/log.rb |