Files
oslo.log/doc/source/usage.rst
Doug Hellmann 4ad39016eb Add API documentation
Add basic API documentation for the public parts of the libary.

Change-Id: Ie3df3c6a1517c2d1b9f9fc052528c62b8fdde388
2015-01-06 14:34:29 -05:00

867 B

Usage

In a Library

oslo.log is primarily used for configuring logging in an application, but it does include helpers that can be useful from libraries.

~oslo_log.log.getLogger wraps the function of the same name from Python's standard library to add a ~oslo_log.log.KeywordArgumentAdapter, making it easier to pass data to the formatters provided by oslo.log and configured by an application.

In an Application

Applications should use oslo.log's configuration functions to register logging-related configuration options and configure the root and other default loggers.

Call ~oslo_log.log.register_options before parsing command line options.

Call ~oslo_log.log.set_defaults before configuring logging.

Call ~oslo_log.log.setup to configure logging for the application.