28 from .logger
import LOGGER
29 from .loggerhelper
import Message
32 LOGGING_THREADS = (
'MainThread',
'RobotFrameworkTimeoutThread')
35 def write(msg, level, html=False):
41 if level.upper()
not in (
'TRACE',
'DEBUG',
'INFO',
'HTML',
'WARN',
'ERROR'):
42 raise DataError(
"Invalid log level '%s'." % level)
43 if threading.currentThread().getName()
in LOGGING_THREADS:
44 LOGGER.log_message(
Message(msg, level, html))
48 write(msg,
'TRACE', html)
52 write(msg,
'DEBUG', html)
55 def info(msg, html=False, also_console=False):
56 write(msg,
'INFO', html)
62 write(msg,
'WARN', html)
66 write(msg,
'ERROR', html)
69 def console(msg, newline=True, stream='stdout'):
73 stream = sys.__stdout__
if stream.lower() !=
'stderr' else sys.__stderr__
Used when variable does not exist.
def debug(msg, html=False)
def error(msg, html=False)
def info(msg, html=False, also_console=False)
def console(msg, newline=True, stream='stdout')
def write(msg, level, html=False)
def trace(msg, html=False)
def warn(msg, html=False)
def console_encode(string, errors='replace', stream=sys.__stdout__)
Encodes Unicode to bytes in console or system encoding.