Class: VidazingLogger::Appenders::LoggingGemAdapter Private

Inherits:
Object
  • Object
show all
Defined in:
lib/vidazing_logger/appenders/logging_gem_adapter.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.

Uses an appender

Since:

  • 0.2.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, vidazing_appender:) ⇒ LoggingGemAdapter

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 LoggingGemAdapter.

Since:

  • 0.2.0



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

def initialize(type:, vidazing_appender:)
  @vidazing_appender = vidazing_appender

  logging_filter = create_logging_filter
  logging_layout = create_logging_layout

  logging_appender_options = create_logging_appender_options \
    filter: logging_filter,
    layout: logging_layout

  @logging_appender = create_logging_appender \
    type: type,
    name: vidazing_appender.name,
    options: logging_appender_options
end

Instance Attribute Details

#logging_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.2.0



14
15
16
# File 'lib/vidazing_logger/appenders/logging_gem_adapter.rb', line 14

def logging_appender
  @logging_appender
end

#vidazing_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.2.0



14
15
16
# File 'lib/vidazing_logger/appenders/logging_gem_adapter.rb', line 14

def vidazing_appender
  @vidazing_appender
end

Class Method Details

.rolling_file(vidazing_appender:) ⇒ Object

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.2.0



106
107
108
109
# File 'lib/vidazing_logger/appenders/logging_gem_adapter.rb', line 106

def rolling_file(vidazing_appender:)
  LoggingGemAdapter.new(type: Type::ID_ROLLING_FILE,
                        vidazing_appender: vidazing_appender)
end

.stderr(vidazing_appender:) ⇒ Object

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.2.0



101
102
103
104
# File 'lib/vidazing_logger/appenders/logging_gem_adapter.rb', line 101

def stderr(vidazing_appender:)
  LoggingGemAdapter.new(type: Type::ID_STDERR,
                        vidazing_appender: vidazing_appender)
end

.stdout(vidazing_appender:) ⇒ Object

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.2.0



96
97
98
99
# File 'lib/vidazing_logger/appenders/logging_gem_adapter.rb', line 96

def stdout(vidazing_appender:)
  LoggingGemAdapter.new(type: Type::ID_STDOUT,
                        vidazing_appender: vidazing_appender)
end