예제 #1
0
파일: tpl.py 프로젝트: gingeleski/OpenDoor
    def debug(msg='', key='', **args):
        """
        Debug log message
        :param str msg: text message
        :param str key: message key for template
        :param mixed args: additional arguments
        :raise TplError
        :return: None
        """

        msg = str(msg)

        try:
            if key:
                msg = Tpl.__format_message(key, args=args)
            logger.log('debug').debug(msg)
        except (AttributeError, TplError) as error:
            raise TplError(error)
예제 #2
0
    def debug(msg='', key='', **args):
        """
        Debug log message
        :param str msg: text message
        :param str key: message key for template
        :param mixed args: additional arguments
        :raise TplError
        :return: None
        """

        msg = str(msg)

        try:
            if key:
                msg = Tpl.__format_message(key, args=args)
            logger.log('debug').debug(msg)
        except (AttributeError, TplError) as error:
            raise TplError(error)
예제 #3
0
파일: tpl.py 프로젝트: ll2b/OpenDoor
    def warning(msg='', key='', **args):
        """
        Warning log message
        :param str msg: text message
        :param str key: message key for template
        :param dict args: additional arguments
        :raise TplError
        :return: None
        """

        msg = str(msg)

        try:
            if key:
                msg = Tpl.__format_message(key, args=args)
            logger.log('warning').warning(msg)
        except (AttributeError, TplError) as e:
            raise TplError(e.message)
예제 #4
0
파일: tpl.py 프로젝트: gingeleski/OpenDoor
    def info(msg='', key='', clear=False, **args):
        """
        Info log message
        :param str msg: text message
        :param str key: message key for template
        :param mixed args: additional arguments
        :param bool clear: clear prev line
        :raise TplError
        :return: None
        """

        msg = str(msg)

        try:
            if key:
                msg = Tpl.__format_message(key, args=args)
            if True is clear:
                sys.writels("")
            logger.log('info').info(msg)
        except (AttributeError, TplError) as error:
            raise TplError(error)
예제 #5
0
    def info(msg='', key='', clear=False, **args):
        """
        Info log message
        :param str msg: text message
        :param str key: message key for template
        :param mixed args: additional arguments
        :param bool clear: clear prev line
        :raise TplError
        :return: None
        """

        msg = str(msg)

        try:
            if key:
                msg = Tpl.__format_message(key, args=args)
            if True is clear:
                sys.writels("")
            logger.log('info').info(msg)
        except (AttributeError, TplError) as error:
            raise TplError(error)
예제 #6
0
파일: tpl.py 프로젝트: gingeleski/OpenDoor
    def cancel(msg='', key='', **args):
        """
        Print message and stop propagation
        :param str msg: text message
        :param str key: message key for template
        :param mixed args: additional arguments
        :raise TplError
        :return: None
        """

        try:
            if key:
                msg = Tpl.__format_message(key, args=args)
            sys.exit(logger.log().warning(msg))
        except (AttributeError, TplError) as error:
            raise TplError(error)
예제 #7
0
    def cancel(msg='', key='', **args):
        """
        Print message and stop propagation
        :param str msg: text message
        :param str key: message key for template
        :param mixed args: additional arguments
        :raise TplError
        :return: None
        """

        try:
            if key:
                msg = Tpl.__format_message(key, args=args)
            sys.exit(logger.log().warning(msg))
        except (AttributeError, TplError) as error:
            raise TplError(error)