You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.logging(to: myCustomLogger) // will use this logger for all 'user-space' logs for any requests made
48
-
.ping()
33
+
// will use this logger for all 'user-space' logs generated while serving this command
34
+
connection.ping(logger: myCustomLogger)
49
35
```
50
36
51
37
## Log Guidelines
52
38
53
39
1. Prefer logging at `trace` levels
54
40
1. Prefer `debug` for any log that contains metadata, especially complex ones like structs or classes
55
41
- exceptions to this guideline may include metadata such as object IDs that are triggering the logs
56
-
1. Dynamic values should be attached as metadata rather than string interpolated
57
-
1. All log metadata keys should be added to the `RedisLogging` namespace
58
-
1. Log messages should be in all lowercase, with no punctuation preferred
59
-
- if a Redis command keyword (such as `QUIT`) is in the log message, it should be in all caps
60
-
1.`warning` logs should be reserved for situations that could lead to `error` or `critical` conditions
61
-
- this may include leaks or bad state
42
+
1. Dynamic values SHOULD be attached as metadata rather than string interpolated
43
+
1. All log metadata keys SHOULD be added to the `RedisLogging` namespace
44
+
1. Log messages SHOULD be in all lowercase, with no punctuation preferred
45
+
- if a Redis command keyword (such as `QUIT`) is in the log message, it MUST be in all caps
46
+
1.`warning` logs SHOULD be reserved for situations that could lead to `error` or `critical` conditions
47
+
- this MAY include leaks or bad state
62
48
1. Only use `error` in situations where the error cannot be expressed by the language, such as by throwing an error or failing `EventLoopFuture`s.
63
49
- this is to avoid high severity logs that developers cannot control and must create filtering mechanisms if they want to ignore emitted logs from **RediStack**
64
50
1. Log a `critical` message before any `preconditionFailure` or `fatalError`
65
51
66
52
### Metadata
67
53
68
-
1. All keys should have the `rdstk` prefix to avoid collisions
69
-
1. Public metadata keys should be 16 characters or less to avoid as many String allocations as possible
70
-
1. Keys should be computed properties to avoid memory costs
54
+
1. All keys SHOULD have the `rdstk` prefix to avoid collisions
55
+
1. Public metadata keys SHOULD be 16 characters or less to avoid as many String allocations as possible
56
+
1. Keys SHOULD be computed properties to avoid memory costs
0 commit comments