Constants – general¶
Seperate constants out so independent of any dependencies
Module private variables
- logging_strict.constants._map_release: types.MappingProxyType = types.MappingProxyType({"alpha": "a", "beta": "b", "candidate": "rc"})¶
Mapping of release levels. So can gracefully go back and forth
- logging_strict.constants.__all__: tuple[str, str, str, str, str, str, str, str] = ("g_app_name", "__version_app", "LoggingConfigCategory", "PREFIX_DEFAULT", "LOG_FORMAT", "FALLBACK_LEVEL", "sanitize_tag", "get_version")¶
Module exports
Module objects
- logging_strict.constants.g_app_name: str = "logging_strict"¶
App name. No hyphens. Lowercase. Not project name which can contain hyphen
- logging_strict.constants.LOG_FORMAT: str = "%(levelname)s %(module)s %(funcName)s: %(lineno)d: %(message)s"¶
logginghandlers contain formatters, which require a format str. Especially pertinent to unittests
- logging_strict.constants.FALLBACK_LEVEL: str = "DEBUG"¶
Fallback logging level, if provided level is an unsupported type, None, or empty str. So by default, this logging level, captures all.
- logging_strict.constants.LOG_FMT_DETAILED: str = "%(asctime)s %(name)-15s %(levelname)-8s %(processName)-10s %(message)s"¶
Detailed log message format. Notably includes: time, logger (worker) name, and process name
- logging_strict.constants.LOG_FMT_SIMPLE: str = "%(name)-15s %(levelname)-8s %(processName)-10s %(message)s"¶
Terse log message format. Notably includes: logger (worker) name and process name
- logging_strict.constants.LOG_LEVEL_WORKER: str = "INFO"¶
Show messages from
logging.INFOand higher
- logging_strict.constants.version_info: tuple[int, int, int, str, int]¶
Same semantics as
sys.version_info
- logging_strict.constants.__version__: str¶
Semantic versioning.
setuptools_scmsemantic versioning in: logging_strict._version.__version__python igor.py bump_version
igor.pyupdates this file, writing both version_info and _devDynamically generated by
setuptools_scmif no patch or no tags at all SemVer will break.e.g. 2.1.devX instead of 2.0.1.devX
Always include patch and ensure at least one tagged version
See also
- class logging_strict.constants.LoggingConfigCategory(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
logging.config yaml process categories
Public API
from logging_strict import LoggingConfigCategory
- UI = 'app'¶
- WORKER = 'worker'¶
- __module__ = 'logging_strict.constants'¶
- classmethod categories()¶
Get Enum items’ value
- Returns:
In this case, Enum values holds str
- Return type: