Class: Protobuf::Logger
- Inherits:
-
Logger
- Object
- Logger
- Protobuf::Logger
- Defined in:
- lib/protobuf/common/logger.rb
Defined Under Namespace
Modules: LogMethods
Class Attribute Summary collapse
-
.file ⇒ Object
Returns the value of attribute file.
-
.level ⇒ Object
Returns the value of attribute level.
Class Method Summary collapse
-
.configure(options) ⇒ Object
One-line file/level configuration.
-
.instance ⇒ Object
Singleton instance.
-
.reset_device! ⇒ Object
Use to reset the instance.
Class Attribute Details
.file ⇒ Object
Returns the value of attribute file.
7 8 9 |
# File 'lib/protobuf/common/logger.rb', line 7 def file @file end |
.level ⇒ Object
Returns the value of attribute level.
7 8 9 |
# File 'lib/protobuf/common/logger.rb', line 7 def level @level end |
Class Method Details
.configure(options) ⇒ Object
One-line file/level configuration
10 11 12 13 |
# File 'lib/protobuf/common/logger.rb', line 10 def configure() self.file = [:file] if [:file] self.level = [:level] if [:level] end |
.instance ⇒ Object
Singleton instance
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/protobuf/common/logger.rb', line 21 def instance @__instance ||= begin log = nil if @file and @level log = new(self.file) log.level = self.level end log end end |
.reset_device! ⇒ Object
Use to reset the instance
16 17 18 |
# File 'lib/protobuf/common/logger.rb', line 16 def reset_device! self.file = self.level = @__instance = nil end |