Module: WDD::Utils::SimpleDebug

Defined in:
lib/wdd-ruby-ext/utils/simpledebug.rb

Instance Method Summary collapse

Instance Method Details

#__debugLevelObject



27
28
29
# File 'lib/wdd-ruby-ext/utils/simpledebug.rb', line 27

def __debugLevel
  return @__debugLevel
end

#debug_msg(message, level = 0) ⇒ Object



35
36
37
38
39
40
# File 'lib/wdd-ruby-ext/utils/simpledebug.rb', line 35

def debug_msg message, level=0
  @__debugLevel ||= -1
  if( level <= @__debugLevel )
    puts debugPrefix + message
  end
end

#debugLevelObject



31
32
33
# File 'lib/wdd-ruby-ext/utils/simpledebug.rb', line 31

def debugLevel
  @__debugLevel
end

#debugPrefixObject



19
20
21
# File 'lib/wdd-ruby-ext/utils/simpledebug.rb', line 19

def debugPrefix
  @__prefix || ""
end

#error_msg(message, level = 0) ⇒ Object



46
47
48
# File 'lib/wdd-ruby-ext/utils/simpledebug.rb', line 46

def error_msg message, level=0
    puts debugPrefix + "ERROR: " + message
end

#set_debug_level(level) ⇒ Object



23
24
25
# File 'lib/wdd-ruby-ext/utils/simpledebug.rb', line 23

def set_debug_level level
  @__debugLevel = level
end

#setDebugLevel(level) ⇒ Object



11
12
13
# File 'lib/wdd-ruby-ext/utils/simpledebug.rb', line 11

def setDebugLevel level
  @__debugLevel = level
end

#setDebugPrefix(__prefix) ⇒ Object



15
16
17
# File 'lib/wdd-ruby-ext/utils/simpledebug.rb', line 15

def setDebugPrefix __prefix
  @__prefix = __prefix
end

#show_msg(message) ⇒ Object



42
43
44
# File 'lib/wdd-ruby-ext/utils/simpledebug.rb', line 42

def show_msg message
    puts debugPrefix + message
end