27 from .logger
import LOGGER
28 from .loggerhelper
import Message
31 LOGGING_THREADS = (
'MainThread',
'RobotFrameworkTimeoutThread')
34 def write(msg, level, html=False):
40 if level.upper()
not in (
'TRACE',
'DEBUG',
'INFO',
'HTML',
'WARN',
'ERROR'):
42 if threading.current_thread().name
in LOGGING_THREADS:
43 LOGGER.log_message(
Message(msg, level, html))
47 write(msg,
'TRACE', html)
51 write(msg,
'DEBUG', html)
54 def info(msg, html=False, also_console=False):
55 write(msg,
'INFO', html)
61 write(msg,
'WARN', html)
65 write(msg,
'ERROR', html)
68 def console(msg, newline=True, stream='stdout'):
72 stream = sys.__stdout__
if stream.lower() !=
'stderr' else sys.__stderr__
def trace(msg, html=False)
def warn(msg, html=False)
def info(msg, html=False, also_console=False)
def console(msg, newline=True, stream='stdout')
def debug(msg, html=False)
def write(msg, level, html=False)
def error(msg, html=False)
def console_encode(string, encoding=None, errors='replace', stream=sys.__stdout__, force=False)
Encodes the given string so that it can be used in the console.