Automatically generate a logger from the calling function

    :param postfix: append another logger name on top this
    :param depth: depth of the call stack at which to capture the caller name
    :return: instance of a logger with a correct path to a current caller

def trc(postfix: Optional[str] = None, *, depth=1) -> logging.Logger:
    """
    Automatically generate a logger from the calling function

    :param postfix: append another logger name on top this
    :param depth: depth of the call stack at which to capture the caller name
    :return: instance of a logger with a correct path to a current caller

    """
    x = inspect.stack()[depth]

    code = x[0].f_code
    func = [obj for obj in gc.get_referrers(code) if inspect.isfunction(obj)][0]

    mod = inspect.getmodule(x.frame)

    parts = (mod.__name__, func.__qualname__)

    if postfix:
        parts += (postfix,)

    logger_name = '.'.join(parts)

    return logging.getLogger(logger_name)