串口
import log
log.basicConfig(level=log.INFO)
Testlog = log.getLogger("TestLog")
# 设置输出到debug口
from machine import UART
uart = UART(UART.UART0, 115200, 8, 0, 1, 0)
log.set_output(uart)
Testlog.info("this is a Test log") # 会输出到对应的uart口
# 从uart口切换成交互口输出
import usys
log.set_output(usys.stdout)
Testlog.info("this is a Test log") # 会输出到交互口