Skip to content

Commit 49c8c81

Browse files
authored
Documentation: create doc describing grpc-go's log levels and their usages (grpc#2033)
1 parent 39a4118 commit 49c8c81

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

Documentation/log_levels.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Log Levels
2+
3+
This document describes the different log levels supported by the grpc-go
4+
library, and under what conditions they should be used.
5+
6+
### Info
7+
8+
Info messages are for informational purposes and may aid in the debugging of
9+
applications or the gRPC library.
10+
11+
Examples:
12+
- The name resolver received an update.
13+
- The balancer updated its picker.
14+
- Significant gRPC state is changing.
15+
16+
At verbosity of 0 (the default), any single info message should not be output
17+
more than once every 5 minutes under normal operation.
18+
19+
### Warning
20+
21+
Warning messages indicate problems that are non-fatal for the application, but
22+
could lead to unexpected behavior or subsequent errors.
23+
24+
Examples:
25+
- Resolver could not resolve target name.
26+
- Error received while connecting to a server.
27+
- Lost or corrupt connection with remote endpoint.
28+
29+
### Error
30+
31+
Error messages represent errors in the usage of gRPC that cannot be returned to
32+
the application as errors, or internal gRPC-Go errors that are recoverable.
33+
34+
Internal errors are detected during gRPC tests and will result in test failures.
35+
36+
Examples:
37+
- Invalid arguments passed to a function that cannot return an error.
38+
- An internal error that cannot be returned or would be inappropriate to return
39+
to the user.
40+
41+
### Fatal
42+
43+
Fatal errors are severe internal errors that are unrecoverable. These lead
44+
directly to panics, and are avoided as much as possible.
45+
46+
Example:
47+
- Internal invariant was violated.
48+
- User attempted an action that cannot return an error gracefully, but would
49+
lead to an invalid state if performed.

0 commit comments

Comments
 (0)