コード例 #1
0
ファイル: logger.py プロジェクト: micken42/robot-demo
def write(msg, level='INFO', html=False):
    """Writes the message to the log file using the given level.

    Valid log levels are ``TRACE``, ``DEBUG``, ``INFO`` (default since RF
    2.9.1), ``WARN``, and ``ERROR`` (new in RF 2.9). Additionally it is
    possible to use ``HTML`` pseudo log level that logs the message as HTML
    using the ``INFO`` level.

    Instead of using this method, it is generally better to use the level
    specific methods such as ``info`` and ``debug`` that have separate
    ``html`` argument to control the message format.
    """
    if EXECUTION_CONTEXTS.current is not None:
        librarylogger.write(msg, level, html)
    else:
        logger = logging.getLogger("RobotFramework")
        level = {
            'TRACE': logging.DEBUG // 2,
            'DEBUG': logging.DEBUG,
            'INFO': logging.INFO,
            'HTML': logging.INFO,
            'WARN': logging.WARN,
            'ERROR': logging.ERROR
        }[level]
        logger.log(level, msg)
コード例 #2
0
ファイル: logger.py プロジェクト: yaogao000/robotframework
def write(msg, level, html=False):
    """Writes the message to the log file using the given level.

    Valid log levels are ``TRACE``, ``DEBUG``, ``INFO`` and ``WARN``.
    Instead of using this method, it is generally better to use the level
    specific methods such as ``info`` and ``debug``.
    """
    librarylogger.write(msg, level, html)
コード例 #3
0
ファイル: logger.py プロジェクト: yamateh/robotframework
def write(msg, level, html=False):
    """Writes the message to the log file using the given level.

    Valid log levels are ``TRACE``, ``DEBUG``, ``INFO`` and ``WARN``.
    Instead of using this method, it is generally better to use the level
    specific methods such as ``info`` and ``debug``.
    """
    librarylogger.write(msg, level, html)
コード例 #4
0
ファイル: logger.py プロジェクト: dataxu/robotframework
def write(msg, level, html=False):
    """Writes the message to the log file using the given level.

    Valid log levels are ``TRACE``, ``DEBUG``, ``INFO`` and ``WARN``.
    Instead of using this method, it is generally better to use the level
    specific methods such as ``info`` and ``debug``.
    """
    if EXECUTION_CONTEXTS.current is not None:
        librarylogger.write(msg, level, html)
    else:
        logger = logging.getLogger("RobotFramework")
        level = {'TRACE': logging.DEBUG/2,
                 'DEBUG': logging.DEBUG,
                 'INFO': logging.INFO,
                 'WARN': logging.WARN}[level]
        logger.log(level, msg)
コード例 #5
0
def write(msg, level, html=False):
    """Writes the message to the log file using the given level.

    Valid log levels are ``TRACE``, ``DEBUG``, ``INFO`` and ``WARN``.
    Instead of using this method, it is generally better to use the level
    specific methods such as ``info`` and ``debug``.
    """
    if EXECUTION_CONTEXTS.current is not None:
        librarylogger.write(msg, level, html)
    else:
        logger = logging.getLogger("RobotFramework")
        level = {'TRACE': logging.DEBUG/2,
                 'DEBUG': logging.DEBUG,
                 'INFO': logging.INFO,
                 'HTML': logging.INFO,
                 'WARN': logging.WARN}[level]
        logger.log(level, msg)
コード例 #6
0
ファイル: logger.py プロジェクト: rwarren14/robotframework
def write(msg, level='INFO', html=False):
    """Writes the message to the log file using the given level.

    Valid log levels are ``TRACE``, ``DEBUG``, ``INFO`` (default since RF
    2.9.1), ``WARN``, and ``ERROR`` (new in RF 2.9). Additionally it is
    possible to use ``HTML`` pseudo log level that logs the message as HTML
    using the ``INFO`` level.

    Instead of using this method, it is generally better to use the level
    specific methods such as ``info`` and ``debug`` that have separate
    ``html`` argument to control the message format.
    """
    if EXECUTION_CONTEXTS.current is not None:
        librarylogger.write(msg, level, html)
    else:
        logger = logging.getLogger("RobotFramework")
        level = {'TRACE': logging.DEBUG/2,
                 'DEBUG': logging.DEBUG,
                 'INFO': logging.INFO,
                 'HTML': logging.INFO,
                 'WARN': logging.WARN,
                 'ERROR': logging.ERROR}[level]
        logger.log(level, msg)
コード例 #7
0
ファイル: logger.py プロジェクト: zbzzbd/rbot_srcCode_copy
def write(msg, level,html=False):
    librarylogger.write(msg,level,html)
コード例 #8
0
def findExcept(string):
    if string.find('Exception') > -1:
        librarylogger.write(string, 'WARN', False)
コード例 #9
0
def write(msg, level='INFO', html=False, console=False):
    if console:
        librarylogger.write(msg, level, html)
        logger.console(msg)
    else:
        librarylogger.write(msg, level, html)