Module woodpecker::spec [] [src]

The logger spec might also be either env_logger spec or a JSON string which defines global and per-module log level.

Simple env_logger spec

The env_logger spec defines the way to set global logging level or on per module basis.

The spec string has a form of:

[level],[module=[level]],...

The level must be a valid logging level level in the range from TRACE to CRITICAL.

If level doesn't match any known logging level it's treated as a module path.

In this case if level is not specified the log level is set to TRACE.

Extended JSON spec

The JSON logging spec allows to specify a fine grained logging settings.

It doesn't suffer from the issue when module or crate path match the logging level.

Also it allows to define logging level for the ranges of lines and potentially define other features supported by woodpecker.

The definition of the JSON spec:

{
    "level": "<global logging level>",
    "modules": [
        {
            "path": "<path to the module>",
            "level": "<module logging level>"
        },
        {
            "path": "<path to the module>",
            "lines": [[<from>, <to>], ...]
        },
        ...
    ]
}

If the global level is not specified then it's left untouched.

The path field of the module object is mandatory while the level and lines fields are optional.

If module level is not specified then it defaults to TRACE.

In case the ranges of lines is omitted the logging for the whole file is defined.

See documentation for the wp_set_level for examples.

Enums

JsonError

JSON log spec parse failure.

ParseError

Generic log spec parse failure.