def console_write(self, color, message):
"""
Writes message to console.
:param color: the colorama color representation.
:param message: str the message to write.
"""
if config.USE_24HOUR:
ts = time.strftime('%H:%M:%S')
else:
ts = time.strftime('%I:%M:%S:%p')
if config.CONSOLE_COLORS:
msg = COLOR['white'] + '[' + ts + '] ' + Style.RESET_ALL + color + message
else:
msg = '[' + ts + '] ' + message
try:
print(msg)
except UnicodeEncodeError as ue:
log.error(ue, exc_info=True)
if config.DEBUG_MODE:
traceback.print_exc()
if config.CHAT_LOGGING:
write_to_log('[' + ts + '] ' + message, self.room_name)
评论列表
文章目录