Have Zig's
std.log log to a file instead of to stderr
1# Examples
2
3You can run the examples by running `zig build -Dexample=<example> run` where `<example>` is one
4of:
5
61. `defaults` - demonstrates no-config behavior.
72. `custom_log_file` - demonstrates custom log file name behavior.
83. `custom_storage_path` - demonstrates custom storage path behavior.
94. `custom_storage_path_and_log_file` - demonstrates custom storage path and log file name
10behavior.
11
12## Running examples in release mode
13
14The command above will run the examples in `Debug` mode. You can also run them in `Release` mode
15with `zig build -Doptimize=<example> -Doptimize=ReleaseFast run`.
16
17> [!IMPORTANT]
18> When in release mode the `defaults` and `custom_log_file` examples will store logs in
19> `~/.local/state/logs/example.log` and `~/.local/state/logs/custom-file.log` respectively.