add(timestamp): timestamp build configuration option to add timestamps before log messages
This commit is contained in:
@@ -63,15 +63,15 @@ pub fn main() void {
|
||||
This will result in the following output:
|
||||
|
||||
```
|
||||
debug(main): Debug message 42
|
||||
info(main): Info message { 1, 2, 3, 4 }
|
||||
info(main): Info message "This is a test"
|
||||
warning(main): Warning message main.Options = enum {
|
||||
[2024-08-28 22:22] debug(main): Debug message 42
|
||||
[2024-08-28 22:22] info(main): Info message { 1, 2, 3, 4 }
|
||||
[2024-08-28 22:22] info(main): Info message "This is a test"
|
||||
[2024-08-28 22:22] warning(main): Warning message main.Options = enum {
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
} = a
|
||||
error(main): Error message main.Struct = struct {
|
||||
[2024-08-28 22:22] error(main): Error message main.Struct = struct {
|
||||
.a = 42,
|
||||
.b = true,
|
||||
.c = []u16: { 1, 2, 3, 4, 5 },
|
||||
@@ -83,3 +83,9 @@ error(main): Error message main.Struct = struct {
|
||||
} = b,
|
||||
}
|
||||
```
|
||||
|
||||
## Customization
|
||||
|
||||
For more details about the output customization see the configuration options of the `zlog` module. Following options are available:
|
||||
|
||||
- _timestamp_ (default: `true`): Prepend the current timestamp before each log message.
|
||||
|
||||
Reference in New Issue
Block a user