Class: ReeLogger::StdoutAppender

Inherits:
Appender
  • Object
show all
Includes:
Ree::LinkDSL
Defined in:
lib/ree_lib/packages/ree_logger/package/ree_logger/appenders/stdout_appender.rb

Instance Attribute Summary

Attributes inherited from Appender

#formatter, #level

Instance Method Summary collapse

Constructor Details

#initialize(level, formatter = nil) ⇒ StdoutAppender

Returns a new instance of StdoutAppender.



15
16
17
18
19
20
# File 'lib/ree_lib/packages/ree_logger/package/ree_logger/appenders/stdout_appender.rb', line 15

def initialize(level, formatter = nil)
  super(
    level,
    formatter || ColorizedFormatter.new
  )
end

Instance Method Details

#append(event, progname = nil) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/ree_lib/packages/ree_logger/package/ree_logger/appenders/stdout_appender.rb', line 24

def append(event, progname = nil)
  message = @formatter.format(event, progname)
  print(message + "\n")
  STDOUT.flush

  nil
end