Module: SkynetDebugger::ClassMethods
- Defined in:
- lib/skynet/skynet_debugger.rb
Instance Method Summary collapse
- #args_pp(*args) ⇒ Object
- #debug(msg, *args) ⇒ Object
- #debug_class_desc ⇒ Object
- #debug_header ⇒ Object
- #error(msg, *args) ⇒ Object
- #fatal(msg, *args) ⇒ Object
- #info(msg, *args) ⇒ Object
- #log ⇒ Object
- #warn(msg, *args) ⇒ Object
Instance Method Details
#args_pp(*args) ⇒ Object
58 59 60 |
# File 'lib/skynet/skynet_debugger.rb', line 58 def args_pp(*args) "#{args.length > 0 ? args.pretty_print_inspect : ''}" end |
#debug(msg, *args) ⇒ Object
62 63 64 |
# File 'lib/skynet/skynet_debugger.rb', line 62 def debug(msg,*args) log.debug "[DEBUG] #{debug_header} #{msg} #{args_pp(*args)}" end |
#debug_class_desc ⇒ Object
45 46 47 |
# File 'lib/skynet/skynet_debugger.rb', line 45 def debug_class_desc self.to_s end |
#debug_header ⇒ Object
49 50 51 52 |
# File 'lib/skynet/skynet_debugger.rb', line 49 def debug_header t = Time.now "##{$$} #{t.strftime("%Y-%m-%d %H:%M:%S")}.#{t.usec} <#{debug_class_desc}>" end |
#error(msg, *args) ⇒ Object
74 75 76 |
# File 'lib/skynet/skynet_debugger.rb', line 74 def error(msg, *args) log.error "[ERROR] #{debug_header} #{msg} #{args_pp(*args)}" end |
#fatal(msg, *args) ⇒ Object
78 79 80 |
# File 'lib/skynet/skynet_debugger.rb', line 78 def fatal(msg, *args) log.fatal "[FATAL] #{debug_header} #{msg} #{args_pp(*args)}" end |
#info(msg, *args) ⇒ Object
66 67 68 |
# File 'lib/skynet/skynet_debugger.rb', line 66 def info(msg, *args) log.info "[INFO] #{debug_header} #{msg} #{args_pp(*args)}" end |
#log ⇒ Object
54 55 56 |
# File 'lib/skynet/skynet_debugger.rb', line 54 def log Skynet::Logger.get end |
#warn(msg, *args) ⇒ Object
70 71 72 |
# File 'lib/skynet/skynet_debugger.rb', line 70 def warn(msg, *args) log.warn "[WARN] #{debug_header} #{msg} #{args_pp(*args)}" end |