class Amazon::Coral::SimpleLog
Provides a straightforward facility to configure SimpleLog
as the active logging mechanism.
- Copyright
-
Copyright © 2008 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Public Class Methods
install(output, level)
click to toggle source
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.
# File lib/amazon/coral/simplelog.rb, line 92 def SimpleLog.install(output, level) LogFactory.setInstance(SimpleLogFactory.new(output, level)) end