Class: TeeLogger::Base
- Inherits:
-
Object
- Object
- TeeLogger::Base
- Defined in:
- lib/tee_logger/base.rb
Overview
base class
Instance Attribute Summary collapse
-
#console ⇒ Object
readonly
Returns the value of attribute console.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #close ⇒ Object
-
#disable(target) ⇒ Object
TODO: Implement.
-
#enable(target) ⇒ Object
TODO: Implement.
-
#initialize(logdev = DEFAULT_FILE, shift_age = 0, shift_size = 1_048_576) ⇒ Base
constructor
A new instance of Base.
- #progname ⇒ Object
- #progname=(name = nil) ⇒ Object
Constructor Details
#initialize(logdev = DEFAULT_FILE, shift_age = 0, shift_size = 1_048_576) ⇒ Base
Returns a new instance of Base.
9 10 11 12 |
# File 'lib/tee_logger/base.rb', line 9 def initialize(logdev = DEFAULT_FILE, shift_age = 0, shift_size = 1_048_576) @logger = Logger.new(logdev, shift_age, shift_size) @console = Logger.new(STDOUT) end |
Instance Attribute Details
#console ⇒ Object (readonly)
Returns the value of attribute console.
7 8 9 |
# File 'lib/tee_logger/base.rb', line 7 def console @console end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
7 8 9 |
# File 'lib/tee_logger/base.rb', line 7 def logger @logger end |
Instance Method Details
#close ⇒ Object
51 52 53 54 |
# File 'lib/tee_logger/base.rb', line 51 def close @logger.close # @console.close end |
#disable(target) ⇒ Object
TODO: Implement
31 32 33 |
# File 'lib/tee_logger/base.rb', line 31 def disable(target) # undef_method, remove_method .... end |
#enable(target) ⇒ Object
TODO: Implement
36 37 38 |
# File 'lib/tee_logger/base.rb', line 36 def enable(target) # undef_method, remove_method .... end |
#progname ⇒ Object
40 41 42 43 44 |
# File 'lib/tee_logger/base.rb', line 40 def progname # TODO: which? # @logger.progname @console.progname end |
#progname=(name = nil) ⇒ Object
46 47 48 49 |
# File 'lib/tee_logger/base.rb', line 46 def progname=(name = nil) @logger.progname = name @console.progname = name end |