Module: SkynetDebugger

Overview

SkynetDebugger

The SkynetDebugger is a module you can include in any of your classes that will give you easy access to the Skynet::Logger. including SkynetDebugger gives you a number of logging methods. Each logging method lets you pass a message as well as an optional number of objects which will be pretty_printed after your message. Log lines print with their log level, PID, time, class, and message. eg.

[WARN] #78002 2008-04-11 14:17:15.363167 <WORKER-78002> Exiting...

You can set the log_level and log_file with (See Skynet::Config)

Skynet::CONFIG[:SKYNET_LOG_FILE]
Skynet::CONFIG[:SKYNET_LOG_LEVEL]

Possible log levels include

Logger::DEBUG 
Logger::INFO
Logger::WARN
Logger::ERROR 
Logger::FATAL

Methods

log - returns the Skynet::Logger

debug(msg,*objects_to_inspect)

info(msg,*objects_to_inspect)

warn(msg,*objects_to_inspect)

error(msg,*objects_to_inspect)

fatal(msg,*objects_to_inspect)

printlog(msg,*objects_to_inspect)  #printlog will ALWAYS print to the log as log level [LOG] regardless of the LOG_LEVEL

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



36
37
38
# File 'lib/skynet/debugger.rb', line 36

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#args_pp(*args) ⇒ Object



44
45
46
# File 'lib/skynet/debugger.rb', line 44

def args_pp(*args)
  self.class.args_pp(*args)
end

#debug(*args) ⇒ Object



48
49
50
# File 'lib/skynet/debugger.rb', line 48

def debug(*args)
  self.class.debug(*args)
end

#debug_headerObject



72
73
74
# File 'lib/skynet/debugger.rb', line 72

def debug_header
  self.class.debug_header
end

#error(*args) ⇒ Object



60
61
62
# File 'lib/skynet/debugger.rb', line 60

def error(*args)
  self.class.error(*args)
end

#fatal(*args) ⇒ Object



64
65
66
# File 'lib/skynet/debugger.rb', line 64

def fatal(*args)
  self.class.fatal(*args)
end

#info(*args) ⇒ Object



52
53
54
# File 'lib/skynet/debugger.rb', line 52

def info(*args)
  self.class.info(*args)
end

#logObject



40
41
42
# File 'lib/skynet/debugger.rb', line 40

def log
  self.class.log
end

#printlog(*args) ⇒ Object



68
69
70
# File 'lib/skynet/debugger.rb', line 68

def printlog(*args)
  self.class.printlog(*args)
end

#stderr(*args) ⇒ Object



76
77
78
# File 'lib/skynet/debugger.rb', line 76

def stderr(*args)
  self.class.stderr
end

#stdout(*args) ⇒ Object



80
81
82
# File 'lib/skynet/debugger.rb', line 80

def stdout(*args)
  self.class.stdout
end

#warn(*args) ⇒ Object



56
57
58
# File 'lib/skynet/debugger.rb', line 56

def warn(*args)
  self.class.warn(*args)
end