Class: Hoodoo::Logger::Payload

Inherits:
Object
  • Object
show all
Defined in:
lib/hoodoo/logger/logger.rb

Overview

Used internally toommunicate details of a log message across the Hoodoo::Communicators::Pool mechanism and through to a log writer. Log writer authors do not need to use this class; Hoodoo::Logger::WriterMixin unpacks it and calls your subclass’s #report implementation with individual parameters for you.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_level:, component:, code:, data:) ⇒ Payload

Create an instance. Named parameters are:

log_level

See Hoodoo::Logger#report.

component

See Hoodoo::Logger#report.

code

See Hoodoo::Logger#report.

data

See Hoodoo::Logger#report.



345
346
347
348
349
350
# File 'lib/hoodoo/logger/logger.rb', line 345

def initialize( log_level:, component:, code:, data: )
  @log_level = log_level
  @component = component
  @code      = code
  @data      = data
end

Instance Attribute Details

#codeObject (readonly)

Code - see Hoodoo::Logger#report.



332
333
334
# File 'lib/hoodoo/logger/logger.rb', line 332

def code
  @code
end

#componentObject (readonly)

Component - see Hoodoo::Logger#report.



328
329
330
# File 'lib/hoodoo/logger/logger.rb', line 328

def component
  @component
end

#dataObject (readonly)

Data - see Hoodoo::Logger#report.



336
337
338
# File 'lib/hoodoo/logger/logger.rb', line 336

def data
  @data
end

#log_levelObject (readonly)

Log level - see Hoodoo::Logger#report.



324
325
326
# File 'lib/hoodoo/logger/logger.rb', line 324

def log_level
  @log_level
end