YAML Validate¶
Validate
logging.configyaml files.Available as an:
ep
via pre-commit
Limitations
logging.handlers.SMTPHandlerargsecuretakes:
None
empty tuple
tuple[str]
tuple[str, str]
Actual: tuple[] or tuple[typing.Any, …]
So can’t prevent
len(Sequence) > 2
logging.handlers.TimedRotatingFileHandlerargasTime
strictyamlhas no support fordatetime.timeModule private variables
- logging_strict.logging_yaml_validate.__all__: tuple[str, str] = ("schema_logging_config", "validate_yaml_dirty")¶
Module exports
Module objects
- logging_strict.logging_yaml_validate.validate_yaml_dirty(yaml_snippet, schema=schema_logging_config)¶
This designed with the intent to verify
logging.configyamlIn
logging.configdocs, all examples shown contain YAML flow_style.YAML flow style (incorrect)
somelist: [item0, item1]Without flow style (Correct)
somelist: - item0 - item1Eventhough it’s easy to fix the yaml,
logging.config.dictConfig()will accept the non-fixed yamlReluctantly … allow flow style
world+dog
refers to the
logging.configdocshave based their code off the
logging.configdocswon’t be aware of yaml intricacies and intrigue
- Parameters:
yaml_snippet (str) –
logging.configYAML strschema (strictyaml.validators.Validator | logging_strict.logging_yaml_validate.schema_logging_config) –
strictyamlstrict typing schema- Returns:
YAML object. Pass this to each worker
- Return type:
See also
Modern way of dealing with Traceback
- class logging_strict.logging_yaml_validate.schema_logging_config¶
strictyamlschema forlogging.configyaml files