Tornado 6.5 Documentation
log.LogFormatter(fmt: str = '%(color)s[%(levelname)1.1s %(asctime)s %(module)s:%(lineno)d]%(end_color)s %(message)s', datefmt: str = '%y%m%d %H:%M:%S', style: str = '%', color: bool = True, colors: Dict[int 2, 30: 3, 40: 1, 50: 5}) Log formatter used in Tornado. Key features of this formatter are: • Color support when logging to a terminal that supports it. • Timestamps on every log line. • Robust against tornado.options. parse_config_file (unless --logging=none is used). Color support on Windows versions that do not support ANSI color codes is enabled by use of the colorama library. Applications that wish0 码力 | 272 页 | 1.12 MB | 2 月前3Rust 程序设计语言 简体中文版 1.85.0
关键字和结构体名开头并后跟元组中的类型。例如,下面是两 个分别叫做 Color 和 Point 元组结构体的定义和用法: 文件名:src/main.rs struct Color(i32, i32, i32); struct Point(i32, i32, i32); fn main() { let black = Color(0, 0, 0); let origin = Point(0 0, 0); } 注意 black 和 origin 值的类型不同,因为它们是不同的元组结构体的实例。你定义的每一个 结构体有其自己的类型,即使结构体中的字段可能有着相同的类型。例如,一个获取 Color 类 型参数的函数不能接受 Point 作为参数,即便这两个类型都由三个 i32 值组成。除此之外, 元组结构体实例类似于元组,你可以将它们解构为单独的部分,也可以使用 . 后跟索引来访问 单独的 会成为这些值的所有者,如示例 8-22 所示: use std::collections::HashMap; let field_name = String::from("Favorite color"); let field_value = String::from("Blue"); let mut map = HashMap::new(); map.insert(field_name0 码力 | 562 页 | 3.23 MB | 9 天前3Tornado 6.5 Documentation
LogFormatter(fmt: str [https://docs.python.org/3/library/stdtypes.html#str] = '% (color)s[%(levelname)1.1s %(asctime)s %(module)s:%(lineno)d]%(end_color)s % (message)s', datefmt: str [https://docs.python.org/3/library/stdtypes html#str] = '%y%m%d %H:%M:%S', style: str [https://docs.python.org/3/library/stdtypes.html#str] = '%', color: bool [https://docs.python.org/3/library/functions.html#bool] = True, colors: Dict [https://docs 20: 2, 30: 3, 40: 1, 50: 5}) Log formatter used in Tornado. Key features of this formatter are: Color support when logging to a terminal that supports it. Timestamps on every log line. Robust against0 码力 | 437 页 | 405.14 KB | 2 月前3
共 3 条
- 1