Class: Relaton::Logger::LogDevice
- Inherits:
-
Logger::LogDevice
- Object
- Logger::LogDevice
- Relaton::Logger::LogDevice
- Defined in:
- lib/relaton/logger/log_device.rb
Instance Method Summary collapse
- #add_log_header(file) ⇒ Object
-
#initialize(logdev, **args) ⇒ LogDevice
constructor
A new instance of LogDevice.
- #truncate ⇒ Object
Constructor Details
#initialize(logdev, **args) ⇒ LogDevice
Returns a new instance of LogDevice.
8 9 10 11 12 |
# File 'lib/relaton/logger/log_device.rb', line 8 def initialize(logdev, **args) # TODO: the header is not used yet, maybe it will be used in the future for not JSON formatters @header = args.delete :header super end |
Instance Method Details
#add_log_header(file) ⇒ Object
14 15 16 17 18 |
# File 'lib/relaton/logger/log_device.rb', line 14 def add_log_header(file) return unless @header super end |
#truncate ⇒ Object
20 21 22 23 24 25 |
# File 'lib/relaton/logger/log_device.rb', line 20 def truncate return unless @dev.respond_to? :truncate @dev.truncate 0 @dev.rewind end |