logging.file module

Functions that configure pwfdf-api file logging streams.

Function

Description

verbose

Configures a file log stream at the DEBUG level

info

Configures a file log stream at the INFO level

quiet

Configures a file log at the WARNING level


pwfdf_api.logging.file.verbose(path, format=None, **handler_kwargs)

Adds a FileHandler at the DEBUG level

File Log
verbose(path)
verbose(path, format)

Adds a FileHandler to the pwfdf-api’s base logger at the DEBUG level, and ensures the pwfdf-api base logger passes messages at this level. The path input is the path to the file that will hold the log. Use format to specify a logging format for the FileHandler. Here, format may either be a logging format string, or a logging.Formatter object.

FileHandler Options
verbose(..., **handler_kwargs)

Specifies additional options for the FileHandler constructor.

Inputs:
  • path (str | Path) – The path to the log file

  • format (str | logging.Formatter) – A logging format string or logging.Formatter object

  • handler_kwargs (Any) – Additional options for the logging.FileHandler constructor

Outputs:

FileHandler – The new pwfdf-api FileHandler

pwfdf_api.logging.file.info(path, format=None, **handler_kwargs)

Adds a FileHandler at the INFO level

File Log
info(path)
info(path, format)

Adds a FileHandler to the pwfdf-api’s base logger at the INFO level, and ensures the pwfdf-api base logger passes messages at this level. The path input is the path to the file that will hold the log. Use format to specify a logging format for the FileHandler. Here, format may either be a logging format string, or a logging.Formatter object.

FileHandler Options
info(..., **handler_kwargs)

Specifies additional options for the FileHandler constructor.

Inputs:
  • path (str | Path) – The path to the log file

  • format (str | logging.Formatter) – A logging format string or logging.Formatter object

  • handler_kwargs (Any) – Additional options for the logging.FileHandler constructor

Outputs:

FileHandler – The new pwfdf-api FileHandler

pwfdf_api.logging.file.quiet(path, format=None, **handler_kwargs: Any)

Adds a FileHandler at the WARNING level

File Log
quiet(path)
quiet(path, format)

Adds a FileHandler to the pwfdf-api’s base logger at the WARNING level, and ensures the pwfdf-api base logger passes messages at this level. The path input is the path to the file that will hold the log. Use format to specify a logging format for the FileHandler. Here, format may either be a logging format string, or a logging.Formatter object.

FileHandler Options
quiet(..., **handler_kwargs)

Specifies additional options for the FileHandler constructor.

Inputs:
  • path (str | Path) – The path to the log file

  • format (str | logging.Formatter) – A logging format string or logging.Formatter object

  • handler_kwargs (Any) – Additional options for the logging.FileHandler constructor

Outputs:

FileHandler – The new pwfdf-api FileHandler