0203睡到0906,不知道是不是因为昨天下午没睡觉,这个晚上睡的还算舒服。
logger.info("收到停止信号")
无法使用sys.stdout.reconfigure(encoding='utf-8')
;直接在powershell中运行py脚本能正常输出中文,但通过dart就乱码了,我没有头绪。
dart端是使用utf8解码的,看来是logger的输出不是utf8,但powershell终端能识别并转化,直接代码运行不行?
使用
1
2
3
4
5
6
7
8
| # 包装 sys.stdout,指定 utf-8
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
handlers=[logging.StreamHandler(sys.stdout)]
)
logger = logging.getLogger(__name__)
|
行了。
越玩越觉得星痕共鸣可玩内容还是太少了,无趣的刷装备,抽象的稀有物品概率。