Class: Amazon::Coral::SimpleLog

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

Overview

Provides a straightforward facility to configure SimpleLog as the active logging mechanism.

Copyright

Copyright © 2008 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Class Method Summary collapse

Class Method Details

.install(output, level) ⇒ Object

Registers a SimpleLogFactory with the specified output IO object and logging level.

To set logging to its highest level and send output to the console, use:

SimpleLog.install(STDOUT, Logger:DEBUG)

To send logging output to a file:

SimpleLog.install(File.new('/tmp/simplelog.log', 'r'), Logger::INFO)

Installing a new LogFactory will not affect objects that have already retrieved their log instances, it’s best to initialize logging as early as possible in your code to ensure that all your code gets the proper configuration.



92
93
94
# File 'lib/amazon/coral/simplelog.rb', line 92

def SimpleLog.install(output, level)
  LogFactory.setInstance(SimpleLogFactory.new(output, level))
end