Class: BlackStack::BaseLogger
- Inherits:
-
Object
- Object
- BlackStack::BaseLogger
show all
- Defined in:
- lib/baselogger.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(the_filename) ⇒ BaseLogger
Returns a new instance of BaseLogger.
5
6
7
8
|
# File 'lib/baselogger.rb', line 5
def initialize(the_filename)
self.filename = the_filename
self.reset()
end
|
Instance Attribute Details
#current_nest_level ⇒ Object
Returns the value of attribute current_nest_level.
3
4
5
|
# File 'lib/baselogger.rb', line 3
def current_nest_level
@current_nest_level
end
|
#filename ⇒ Object
Returns the value of attribute filename.
3
4
5
|
# File 'lib/baselogger.rb', line 3
def filename
@filename
end
|
#nest_level ⇒ Object
Returns the value of attribute nest_level.
3
4
5
|
# File 'lib/baselogger.rb', line 3
def nest_level
@nest_level
end
|
#number_of_lines_in_current_level ⇒ Object
Returns the value of attribute number_of_lines_in_current_level.
3
4
5
|
# File 'lib/baselogger.rb', line 3
def number_of_lines_in_current_level
@number_of_lines_in_current_level
end
|
Instance Method Details
#done ⇒ Object
28
29
30
|
# File 'lib/baselogger.rb', line 28
def done()
self.logf("done")
end
|
#error(e = nil) ⇒ Object
32
33
34
35
|
# File 'lib/baselogger.rb', line 32
def error(e=nil)
self.logf("error") if e.nil?
self.logf("error:#{e.to_s}.") if !e.nil?
end
|
#log(s) ⇒ Object
16
17
18
|
# File 'lib/baselogger.rb', line 16
def log(s)
raise "This is an abstract method."
end
|
#logf(s) ⇒ Object
24
25
26
|
# File 'lib/baselogger.rb', line 24
def logf(s)
raise "This is an abstract method."
end
|
#logs(s) ⇒ Object
20
21
22
|
# File 'lib/baselogger.rb', line 20
def logs(s)
raise "This is an abstract method."
end
|
#no ⇒ Object
41
42
43
|
# File 'lib/baselogger.rb', line 41
def no()
self.logf("no")
end
|
#reset ⇒ Object
10
11
12
13
14
|
# File 'lib/baselogger.rb', line 10
def reset()
self.nest_level = 0
self.current_nest_level = 0
self.number_of_lines_in_current_level = 0
end
|
#yes ⇒ Object
37
38
39
|
# File 'lib/baselogger.rb', line 37
def yes()
self.logf("yes")
end
|