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.PREFIX_DEFAULT: str = "test_"

unittest module default file name prefix

logging_strict.constants.LOG_FORMAT: str = "%(levelname)s %(module)s %(funcName)s: %(lineno)d: %(message)s"

logging handlers 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.INFO and higher

logging_strict.constants.version_info: tuple[int, int, int, str, int]

Same semantics as sys.version_info

logging_strict.constants._dev: int

.devN suffix, if any

logging_strict.constants.__version__: str

Semantic versioning.

setuptools_scm semantic versioning in: logging_strict._version.__version__

python igor.py bump_version

igor.py updates this file, writing both version_info and _dev

Dynamically generated by setuptools_scm if 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

setuptools_scm

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:

collections.abc.Iterator[str]