Class: VidazingLogger::Appenders::Basic Private

Inherits:
Object
  • Object
show all
Defined in:
lib/vidazing_logger/appenders/basic.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Appender writing to log files

Since:

  • 0.1.0

Direct Known Subclasses

Log, Stderr, Stdout

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, id:) ⇒ Basic

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Basic

Since:

  • 0.1.0



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/vidazing_logger/appenders/basic.rb', line 15

def initialize(type:, id:)
  @layout = VidazingLogger::LayoutPattern.new(color_scheme_id: @color_scheme_id).layout

  appender_args = [
    filters: @filter,
    layout: @layout,
    # These are specific to Appenders::Type.rolling_file
    # But the underlying logging library uses opts.fetch
    # So these will be ignored for other appenders types
    age: 'daily',
    keep: 7
  ]

  @appender = Appenders::Type.create \
    type: type,
    id: id,
    args: appender_args
end

Instance Attribute Details

#appenderObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



13
14
15
# File 'lib/vidazing_logger/appenders/basic.rb', line 13

def appender
  @appender
end