I have some sentence with custom encoded characters. when using Loguru, it raises UnicodeEncodeError because it can't encode my sentence due to those custom characters, so I hope I can handle error by myself, what should I do?
you can wrap logger with try-except:
def log(message):
try:
loguru.logger.info(message)
except UnicodeEncodeError:
print('...')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.