Source code for luna_tasks.crutches_on_wheels.cow.utils.log
"""Loggers
Loggers module.
"""
from log import Logger as BaseLogger
from .rid import requestIdCtx
[docs]
class Logger(BaseLogger):
"""
Subclass to add support for requestIdCtx.
"""
@property
def requestId(self) -> str:
"""
Get current request id
Returns:
request id. priority: 1) request id from __init__ 2) from requestIdCtx 3) default
"""
return self._requestId or requestIdCtx.get() or self.defaultRequestId
# global service logger
logger = Logger() #: pylint: disable-msg=C0103