log.error换行
时间: 2023-05-23 19:07:10 浏览: 263
Log4j.properties配置详解.doc
A:在log.error中换行可以使用"\n"或者使用Python中的三引号字符串,例如:
```
import logging
logging.basicConfig(level=logging.ERROR, format='%(asctime)s %(levelname)s:\n%(message)s')
logging.error('This is a first line.\nThis is a second line.')
```
或
```
import logging
logging.basicConfig(level=logging.ERROR, format='%(asctime)s %(levelname)s:\n%(message)s')
logging.error('''This is a
first line.
This is a
second line.''')
```
阅读全文