Utilities

openstack.utils.enable_logging(debug=False, path=None, stream=None)

Enable logging to a file at path and/or a console stream.

This function is available for debugging purposes. If you wish to log this package’s message in your application, the standard library logging package will receive these messages in any handlers you create.

Parameters:
  • debug (bool) – Set this to True to receive debug messages, which includes HTTP requests and responses, or False for warning messages.
  • path (str) – If a path is specified, logging output will written to that file in addition to sys.stderr. The path is passed to logging.FileHandler, which will append messages the file (and create it if needed).
  • stream – One of None `` or ``sys.stdout or sys.stderr. If it is None, nothing is logged to a stream. If it isn’t None, console output is logged to this stream.
Return type:

None