Class: MyLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/logwin.rb

Constant Summary collapse

MISC =
0
CODE =
1
DEBUG =
2
INFO =
3
WARN =
4
ERROR =
5
FATAL =
6
UNKNOWN =
7

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logDevice) ⇒ MyLogger

Returns a new instance of MyLogger.



44
45
46
47
# File 'lib/logwin.rb', line 44

def initialize(logDevice)
    @logdev = logDevice
    @level = 0
end

Instance Attribute Details

#levelObject

Returns the value of attribute level.



42
43
44
# File 'lib/logwin.rb', line 42

def level
  @level
end

Instance Method Details

#code(msg = nil, &block) ⇒ Object



54
55
56
# File 'lib/logwin.rb', line 54

def code(msg = nil, &block)
    add(CODE, msg, &block)
end

#debug(msg = nil, &block) ⇒ Object



58
59
60
# File 'lib/logwin.rb', line 58

def debug(msg = nil, &block)
    add(DEBUG, msg, &block)
end

#error(msg = nil, &block) ⇒ Object



70
71
72
# File 'lib/logwin.rb', line 70

def error(msg = nil, &block)
    add(ERROR, msg, &block)
end

#fatal(msg = nil, &block) ⇒ Object



74
75
76
# File 'lib/logwin.rb', line 74

def fatal(msg = nil, &block)
    add(FATAL, msg, &block)
end

#info(msg = nil, &block) ⇒ Object



62
63
64
# File 'lib/logwin.rb', line 62

def info(msg = nil, &block)
    add(INFO, msg, &block)
end

#misc(msg = nil, &block) ⇒ Object



50
51
52
# File 'lib/logwin.rb', line 50

def misc(msg = nil, &block)
    add(MISC, msg, &block)
end

#warn(msg = nil, &block) ⇒ Object



66
67
68
# File 'lib/logwin.rb', line 66

def warn(msg = nil, &block)
    add(WARN, msg, &block)
end