Class: Amazon::Coral::SimpleLogFactory

Inherits:
LogFactory show all
Defined in:
lib/amazon/coral/simplelog.rb

Overview

Provides a LogFactory implementation that supplies WrappedLogger objects to requestors. The key provided to getLog is prepended to log messages from each Logger.

Copyright

Copyright (c) 2008 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Instance Method Summary collapse

Methods inherited from LogFactory

getLog, setInstance

Constructor Details

#initialize(output, level) ⇒ SimpleLogFactory

Returns a new instance of SimpleLogFactory.



62
63
64
65
# File 'lib/amazon/coral/simplelog.rb', line 62

def initialize(output, level)
  @output = output
  @level = level
end

Instance Method Details

#getLog(key) ⇒ Object



67
68
69
70
71
72
# File 'lib/amazon/coral/simplelog.rb', line 67

def getLog(key)
  logger = Logger.new(@output)
  logger.level = @level

  return WrappedLogger.new(key, logger)
end