Class: Cogger::Configuration
- Inherits:
-
Data
- Object
- Data
- Cogger::Configuration
- Defined in:
- lib/cogger/configuration.rb
Overview
Defines the default configuration for all pipes.
Instance Attribute Summary collapse
-
#age ⇒ Object
readonly
Returns the value of attribute age.
-
#datetime_format ⇒ Object
readonly
Returns the value of attribute datetime_format.
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#io ⇒ Object
readonly
Returns the value of attribute io.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#mutex ⇒ Object
readonly
Returns the value of attribute mutex.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#suffix ⇒ Object
readonly
Returns the value of attribute suffix.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #entag(other = nil) ⇒ Object
-
#initialize(id: Program.call, io: $stdout, level: Level.call, formatter: Formatters::Emoji.new, datetime_format: DATETIME_FORMAT, tags: Core::EMPTY_ARRAY, header: false, mode: false, age: nil, size: 1_048_576, suffix: "%Y-%m-%d", entry: Entry, logger: Logger, mutex: Mutex.new) ⇒ Configuration
constructor
A new instance of Configuration.
- #inspect ⇒ Object
- #to_logger ⇒ Object
Constructor Details
#initialize(id: Program.call, io: $stdout, level: Level.call, formatter: Formatters::Emoji.new, datetime_format: DATETIME_FORMAT, tags: Core::EMPTY_ARRAY, header: false, mode: false, age: nil, size: 1_048_576, suffix: "%Y-%m-%d", entry: Entry, logger: Logger, mutex: Mutex.new) ⇒ Configuration
Returns a new instance of Configuration.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/cogger/configuration.rb', line 27 def initialize id: Program.call, io: $stdout, level: Level.call, formatter: Formatters::Emoji.new, datetime_format: DATETIME_FORMAT, tags: Core::EMPTY_ARRAY, header: false, mode: false, age: nil, size: 1_048_576, suffix: "%Y-%m-%d", entry: Entry, logger: Logger, mutex: Mutex.new super.tap { .freeze } end |
Instance Attribute Details
#age ⇒ Object (readonly)
Returns the value of attribute age
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def age @age end |
#datetime_format ⇒ Object (readonly)
Returns the value of attribute datetime_format
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def datetime_format @datetime_format end |
#entry ⇒ Object (readonly)
Returns the value of attribute entry
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def entry @entry end |
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def formatter @formatter end |
#header ⇒ Object (readonly)
Returns the value of attribute header
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def header @header end |
#id ⇒ Object (readonly)
Returns the value of attribute id
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def id @id end |
#io ⇒ Object (readonly)
Returns the value of attribute io
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def io @io end |
#level ⇒ Object (readonly)
Returns the value of attribute level
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def level @level end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def logger @logger end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def mode @mode end |
#mutex ⇒ Object (readonly)
Returns the value of attribute mutex
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def mutex @mutex end |
#size ⇒ Object (readonly)
Returns the value of attribute size
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def size @size end |
#suffix ⇒ Object (readonly)
Returns the value of attribute suffix
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def suffix @suffix end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags
9 10 11 |
# File 'lib/cogger/configuration.rb', line 9 def @tags end |
Instance Method Details
#entag(other = nil) ⇒ Object
44 |
# File 'lib/cogger/configuration.rb', line 44 def entag(other = nil) = other ? .including(other) : |
#inspect ⇒ Object
59 60 61 62 63 64 |
# File 'lib/cogger/configuration.rb', line 59 def inspect "#<#{self.class} @id=#{id}, @io=#{io.class}, @level=#{level}, " \ "@formatter=#{formatter.class}, @datetime_format=#{datetime_format.inspect}, " \ "@tags=#{.inspect}, @header=#{header}, @mode=#{mode}, @age=#{age}, @size=#{size}, " \ "@suffix=#{suffix.inspect}, @entry=#{entry}, @logger=#{logger}>" end |
#to_logger ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/cogger/configuration.rb', line 46 def to_logger logger.new io, age, size, progname: id, level:, formatter:, datetime_format:, skip_header: skip_header?, binmode: mode, shift_period_suffix: suffix end |