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



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/stackify_apm/logger/logger_high_version.rb', line 16

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('-1.log', '')
      new_logdev = temp_filename + '-1.log'
    end
    begin
      @logdev = LogDevice.new(new_logdev, shift_size: shift_size)
    rescue StandardError => e
      puts "Stackify Profiler unable to access [" + logdev + "]"
    end
  end
end