class Mongrel2::Config::Log
Public Class Methods
log_action( what, why=nil, where=nil, how=nil )
click to toggle source
Log
an entry to the commit log with the given what
, why
, where
, and how
values and return it after it's saved.
# File lib/mongrel2/config/log.rb, line 23 def self::log_action( what, why=nil, where=nil, how=nil ) where ||= Socket.gethostname how ||= File.basename( $0 ) who = Etc.getlogin return self.create( who: who, what: what, location: where, how: how, why: why ) end
Public Instance Methods
happened_at()
click to toggle source
Get the timestamp of the event.
# File lib/mongrel2/config/log.rb, line 58
how()
click to toggle source
Get a description of “how” the event happened.
# File lib/mongrel2/config/log.rb, line 62
id()
click to toggle source
Get the ID of the log entry
# File lib/mongrel2/config/log.rb, line 42
location()
click to toggle source
Get the “where” of the event.
# File lib/mongrel2/config/log.rb, line 54
to_s()
click to toggle source
Stringify the log entry and return it.
# File lib/mongrel2/config/log.rb, line 72 def to_s # 2011-09-09 19:35:40 [who] @where how: what (why) msg = "%{happened_at} [%{who}] @%{location} %{how}: %{what}" % self.values msg += " (#{self.why})" if self.why return msg end
what()
click to toggle source
Get a description of “what” happened
# File lib/mongrel2/config/log.rb, line 50
who()
click to toggle source
Get “who” was reponsible for the event.
# File lib/mongrel2/config/log.rb, line 46
why()
click to toggle source
Get a description of “why” the event happened.
# File lib/mongrel2/config/log.rb, line 66