Method: RightScale::Log::Formatter#msg2str

Defined in:
lib/right_agent/log.rb

#msg2str(msg) ⇒ Object

Converts some argument to a Logger.severity() call to a string Regular strings pass through like normal, Exceptions get formatted as “message (class)nbacktrace”, and other random stuff gets put through “object.inspect”

Parameters

msg(Object)

Message object to be converted to string

Return

String



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/right_agent/log.rb', line 87

def msg2str(msg)
 case msg
 when ::String
   msg
 when ::Exception
   "#{ msg.message } (#{ msg.class })\n" <<
     (msg.backtrace || []).join("\n")
 else
   msg.inspect
  end
end