module Vital
Public Instance Methods
vital(msg='',ops={})
click to toggle source
Log a message with timestamp, calling class, method name, process info, etc.
Example¶ ↑
vital("hello") => logger.info 2010-12-31 class_name method_name process_info ... hello
# File lib/sixarm_ruby_vital.rb, line 15 def vital(msg='',ops={}) method_name = ops[:method_name]||method_name_of_caller logger.info [Time.stamp,self.class.name,method_name,Process.ps_tdf].join("\t")+"\t"+msg end
vital_open(msg='',ops={})
click to toggle source
Log a message that is intended to open (i.e. begin) a topic.
This simply calls vital with “+” prepended to the message, which is our indicator of a new topic.
Example:
vital_open("hello") => logger.info 2010-12-31 class_name method_name process_info ... +hello
# File lib/sixarm_ruby_vital.rb, line 30 def vital_open(msg='',ops={}) vital('+'+msg,ops.merge({:method_name=>method_name_of_caller})) end
vital_shut(msg='',ops={})
click to toggle source
Log a message that is intended to shut (i.e. end) a topic.
This simply calls vital with “+” prepended to the message, which is our indicator of a new topic.
Example:
vital_open("hello") => logger.info 2010-12-31 class_name method_name process_info ... -hello
# File lib/sixarm_ruby_vital.rb, line 44 def vital_shut(msg='',ops={}) vital('-'+msg,ops.merge({:method_name=>method_name_of_caller})) end