1
2
3
4
5
6
7
8
9
10
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
use ;
use crateExample;
// You can run this example with `cargo run --example basic -- trace`
// In this example we will learn about afire's built-in tracing system.
// Because of how its used internally there is a global log level, not one per server.
// You can set this level with `afire::trace::set_log_level`, which takes one parameter a `afire::trace::Level`.
// You can also set wether the logs have ANSI codes for color using `afire::trace::set_log_color`, color is enabled by default.
// Now to use the logger there is the `trace!` macro, which you can use one of two different ways:
//
// trace!(Level::<LOG_LEVEL>, <FORMATTED ARGS>)
// trace!(<FORMATTED ARGS>) // uses the Trace level
//
// // Examples
// let a = 100;
// trace!("The var a is currently {a}");
// trace!(Level::Error, "An error occurred!");
//
// The Log Levels are in the following order, with the more verbose levels at the bottom.
// Setting the log level to Off will disable all logging.
// Also note that Error is the default level.
//
// - Off
// - Error
// - Trace
// - Debug
;