Class: SingletonLogger
- Inherits:
-
Logger
- Object
- Logger
- SingletonLogger
- Defined in:
- lib/dmorrill10-utils/singleton_logger.rb
Constant Summary collapse
- @@log =
Logger.new(STDOUT)
Class Method Summary collapse
- .instance ⇒ Object
- .respond_to_missing?(name, include_private = false) ⇒ Boolean
- .set_log_file!(file) ⇒ Object
- .set_log_to_stderr! ⇒ Object
- .set_log_to_stdout! ⇒ Object
Class Method Details
.instance ⇒ Object
6 7 8 |
# File 'lib/dmorrill10-utils/singleton_logger.rb', line 6 def self.instance @@log end |
.respond_to_missing?(name, include_private = false) ⇒ Boolean
25 26 27 |
# File 'lib/dmorrill10-utils/singleton_logger.rb', line 25 def self.respond_to_missing?(name, include_private=false) @@log.respond_to?(name, include_private) or super end |
.set_log_file!(file) ⇒ Object
11 12 13 14 15 |
# File 'lib/dmorrill10-utils/singleton_logger.rb', line 11 def self.set_log_file!(file) @@log = Logger.new(file) self end |
.set_log_to_stderr! ⇒ Object
21 22 23 |
# File 'lib/dmorrill10-utils/singleton_logger.rb', line 21 def self.set_log_to_stderr! set_log_file!(STDERR) end |
.set_log_to_stdout! ⇒ Object
17 18 19 |
# File 'lib/dmorrill10-utils/singleton_logger.rb', line 17 def self.set_log_to_stdout! set_log_file!(STDOUT) end |