Class: StackifyRubyAPM::StackifyLogger Private

Inherits:
Logger
  • Object
show all
Defined in:
lib/stackify_apm/logger/logger_high_version.rb,
lib/stackify_apm/logger/logger_lower_version.rb

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.

Instance Method Summary collapse

Constructor Details

#initialize(logdev, shift_age = 0, shift_size = 1048576) ⇒ StackifyLogger

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.

rubocop:disable Style/NumericLiterals rubocop:disable Style/GuardClause



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/stackify_apm/logger/logger_high_version.rb', line 15

def initialize(logdev, shift_age = 0, shift_size = 1048576, level: DEBUG,
               progname: nil, formatter: nil, datetime_format: nil,
               shift_period_suffix: '%Y%m%d')
  super(nil) # this prevents it from initializing a LogDevice
  @logdev = nil
  if logdev
    new_logdev = logdev
    if logdev.instance_of? String
      temp_filename = logdev.gsub('.log', '')
      new_logdev = temp_filename + '-1.log'
    end
    @logdev = LogDevice.new(new_logdev, shift_age: shift_age,
                                        shift_size: shift_size,
                                        shift_period_suffix: shift_period_suffix)
  end
end