Skip to content

deep.logging

Deep client logging api.

debug(msg, *args, **kwargs)

Log a message at debug level.

:param msg: the message to log :param args: the args for the log :param kwargs: the kwargs

Source code in deep/logging/__init__.py
def debug(msg, *args, **kwargs):
    """
    Log a message at debug level.

    :param msg: the message to log
    :param args:  the args for the log
    :param kwargs: the kwargs
    """
    logging.getLogger("deep").debug(msg, *args, **kwargs)

error(msg, *args, **kwargs)

Log a message at error level.

:param msg: the message to log :param args: the args for the log :param kwargs: the kwargs

Source code in deep/logging/__init__.py
def error(msg, *args, **kwargs):
    """
    Log a message at error level.

    :param msg: the message to log
    :param args:  the args for the log
    :param kwargs: the kwargs
    """
    logging.getLogger("deep").error(msg, *args, **kwargs)

exception(msg, *args, exc_info=True, **kwargs)

Log a message with the exception data.

:param msg: the message to log :param args: the args for the log :param exc_info: include exc info in log :param kwargs: the kwargs

Source code in deep/logging/__init__.py
def exception(msg, *args, exc_info=True, **kwargs):
    """
    Log a message with the exception data.

    :param msg: the message to log
    :param args:  the args for the log
    :param exc_info: include exc info in log
    :param kwargs: the kwargs
    """
    logging.getLogger("deep").exception(msg, *args, exc_info=exc_info, **kwargs)

info(msg, *args, **kwargs)

Log a message at info level.

:param msg: the message to log :param args: the args for the log :param kwargs: the kwargs

Source code in deep/logging/__init__.py
def info(msg, *args, **kwargs):
    """
    Log a message at info level.

    :param msg: the message to log
    :param args:  the args for the log
    :param kwargs: the kwargs
    """
    logging.getLogger("deep").info(msg, *args, **kwargs)

init(cfg=None)

Configure the deep log provider.

:param cfg: the config for deep.

Source code in deep/logging/__init__.py
def init(cfg=None):
    """
    Configure the deep log provider.

    :param cfg: the config for deep.
    """
    log_conf = "%s/logging.conf" % os.path.dirname(os.path.realpath(__file__))

    if cfg is not None and cfg.LOGGING_CONF:
        log_conf = cfg.LOGGING_CONF

    logging.config.fileConfig(fname=log_conf, disable_existing_loggers=False)

warning(msg, *args, **kwargs)

Log a message at warning level.

:param msg: the message to log :param args: the args for the log :param kwargs: the kwargs

Source code in deep/logging/__init__.py
def warning(msg, *args, **kwargs):
    """
    Log a message at warning level.

    :param msg: the message to log
    :param args:  the args for the log
    :param kwargs: the kwargs
    """
    logging.getLogger("deep").warning(msg, *args, **kwargs)