Exemple #1
0
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)
Exemple #2
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``.
    """
    librarylogger.write(msg, level, html)
Exemple #3
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``.
    """
    librarylogger.write(msg, level, html)
Exemple #4
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,
                 'WARN': logging.WARN}[level]
        logger.log(level, msg)
Exemple #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)
Exemple #6
0
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)
Exemple #7
0
def write(msg, level,html=False):
    librarylogger.write(msg,level,html)
Exemple #8
0
def findExcept(string):
    if string.find('Exception') > -1:
        librarylogger.write(string, 'WARN', False)
Exemple #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)