module Pione::Log::Debug

Debug is a log utility module for showing debug messages. Messages are shown when according debug flags (system, rule_engine, notification, communication, ignored_exception) are available.

Public Class Methods

communication(msg_or_exc=nil, pos=caller(1).first, &b) click to toggle source

Show a debug message abount object communication. This message is visible when Global.debug_communication is true.

# File lib/pione/log/debug.rb, line 33
def self.communication(msg_or_exc=nil, pos=caller(1).first, &b)
  if Global.debug_communication
    print(:communication, msg_or_exc, pos, &b)
  end
end
ignored_exception(msg_or_exc=nil, pos=caller(1).first, &b) click to toggle source

Show a ignored exception. This message is visible when Global.debug_ignored_exception is true.

# File lib/pione/log/debug.rb, line 41
def self.ignored_exception(msg_or_exc=nil, pos=caller(1).first, &b)
  if Global.debug_ignored_exception
    print(:ignored_exception, msg_or_exc, pos, &b)
  end
end
notification(msg_or_exc=nil, pos=caller(1).first, &b) click to toggle source

Show a debug message about notification. This message is visible when ‘Global.debug_notification` is true.

# File lib/pione/log/debug.rb, line 25
def self.notification(msg_or_exc=nil, pos=caller(1).first, &b)
  if Global.debug_notification
    print(:notification, msg_or_exc, pos, &b)
  end
end
rule_engine(msg_or_exc=nil, pos=caller(1).first, &b) click to toggle source

Show a debug message about rule engine activity. This message is visible when ‘Global.debug_rule_engine` is true in client side.

# File lib/pione/log/debug.rb, line 17
def self.rule_engine(msg_or_exc=nil, pos=caller(1).first, &b)
  if Global.debug_rule_engine
    print(:rule_engine, msg_or_exc, pos, &b)
  end
end
system(msg_or_exc=nil, pos=caller(1).first, &b) click to toggle source

Show a debug message about PIONE system activity. This message is visible when ‘Global.debug_system` is true.

# File lib/pione/log/debug.rb, line 9
def self.system(msg_or_exc=nil, pos=caller(1).first, &b)
  if Global.debug_system
    print(:system, msg_or_exc, pos, &b)
  end
end

Private Class Methods

prefix(type) click to toggle source
# File lib/pione/log/debug.rb, line 70
def self.prefix(type)
  type.to_s.underline
end
print(type, msg_or_exc, pos, &b) click to toggle source

Print a debug message or an exception.

print_debug_message(type, msg, pos) click to toggle source

Print a debug message.

print_exception(type, e, pos) click to toggle source

Print an exception.