logging_config#

caput.config.logging_config(default: str | dict | None = None) Property[str | dict][source]#

Property type that validates the caput logging config.

Allows the type to be either a string (for backward compatibility) or a dict setting log levels per module.

Parameters:
defaultstr | dict | None, optional

The optional default logging config. A simple string level is applied to the root logger.

Returns:
logging_configProperty

A property instance setup to validate the type.

Examples

Should be used like:

class Project:
    loglevels = logging_config({"root": "INFO", "annoying.module": "WARNING"})