jinja2.make_logging_undefined

jinja2.make_logging_undefined(logger=None, base=None)[source]

Given a logger object this returns a new undefined class that will log certain failures. It will log iterations and printing. If no logger is given a default logger is created.

Example:

logger = logging.getLogger(__name__)
LoggingUndefined = make_logging_undefined(
    logger=logger,
    base=Undefined
)

New in version 2.8.

Parameters:
  • logger – the logger to use. If not provided, a default logger is created.
  • base – the base class to add logging functionality to. This defaults to Undefined.