pinylib.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:pinylib-rtc 作者: nortxort 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号