formatting
LoggingFormatBuilder
¶
>>> logging_format: str = LoggingFormatBuilder(separator=" | ") \
... .add_asctime() \
... .add_levelname(".3") \
... .add_module("<10") \
... .add_lineno(">3") \
... .add_message() \
... .build()
Source code in src/loggext/formatting/builder.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
add_asctime(fmt=None)
¶
Human-readable time when the LogRecord was created. By default, this is of the form ‘2003-07-08 16:49:45,896’ (the numbers after the comma are millisecond portion of the time).
Source code in src/loggext/formatting/builder.py
add_created(fmt=None)
¶
Time when the LogRecord was created (as returned by time.time()).
add_field(name, fmt=None)
¶
adds a custom field
add_filename(fmt=None)
¶
add_funcname(fmt=None)
¶
add_levelname(fmt=None)
¶
Numeric logging level for the message (DEBUG, INFO, WARNING, ERROR, CRITICAL).
add_levelno(fmt=None)
¶
Numeric logging level for the message (DEBUG, INFO, WARNING, ERROR, CRITICAL).
add_lineno(fmt=None)
¶
Source line number where the logging call was issued (if available).
add_literal(literal)
¶
add_message(fmt=None)
¶
The logged message, computed as msg % args. This is set when Formatter.format() is invoked.
add_module(fmt=None)
¶
add_msecs(fmt=None)
¶
add_name(fmt=None)
¶
add_pathname(fmt=None)
¶
Full pathname of the source file where the logging call was issued (if available).
add_process(fmt=None)
¶
add_processname(fmt=None)
¶
add_relativecreated(fmt=None)
¶
Time in milliseconds when the LogRecord was created, relative to the time the logging module was loaded.