runway.cfngin.logger package

CFNgin logger.

class runway.cfngin.logger.ColorFormatter(fmt=None, datefmt=None, style='%')[source]

Bases: logging.Formatter

Handles colorizing formatted log messages if color provided.

Initialize the formatter with specified format strings.

Initialize the formatter either with the specified format string, or a default as described above. Allow for specialized date formatting with the optional datefmt argument. If datefmt is omitted, you get an ISO8601-like (or RFC 3339-like) format.

Use a style parameter of ‘%’, ‘{‘ or ‘$’ to specify that you want to use one of %-formatting, str.format() ({}) formatting or string.Template formatting in your format string.

Changed in version 3.2: Added the style parameter.

format(record: logging.LogRecord)str[source]

Format log message.

runway.cfngin.logger.setup_logging(verbosity: int, formats: Optional[Dict[str, Any]] = None)[source]

Configure a proper logger based on verbosity and optional log formats.

  • verbosity – 0, 1, 2

  • formats – Keys (info, color, debug) which may override the associated default log formats.