|
1 | 1 | ## Logging Conventions
|
2 | 2 |
|
3 |
| -The following conventions for the glog levels to use. |
4 |
| -[glog](http://godoc.org/github.com/golang/glog) is globally preferred to |
| 3 | +The following conventions for the klog levels to use. |
| 4 | +[klog](http://godoc.org/github.com/kubernetes/klog) is globally preferred to |
5 | 5 | [log](http://golang.org/pkg/log/) for better runtime control.
|
6 | 6 |
|
7 |
| -* glog.Errorf() - Always an error |
| 7 | +* klog.Errorf() - Always an error |
8 | 8 |
|
9 |
| -* glog.Warningf() - Something unexpected, but probably not an error |
| 9 | +* klog.Warningf() - Something unexpected, but probably not an error |
10 | 10 |
|
11 |
| -* glog.Infof() has multiple levels: |
12 |
| - * glog.V(0) - Generally useful for this to ALWAYS be visible to an operator |
| 11 | +* klog.Infof() has multiple levels: |
| 12 | + * klog.V(0) - Generally useful for this to ALWAYS be visible to an operator |
13 | 13 | * Programmer errors
|
14 | 14 | * Logging extra info about a panic
|
15 | 15 | * CLI argument handling
|
16 |
| - * glog.V(1) - A reasonable default log level if you don't want verbosity. |
| 16 | + * klog.V(1) - A reasonable default log level if you don't want verbosity. |
17 | 17 | * Information about config (listening on X, watching Y)
|
18 | 18 | * Errors that repeat frequently that relate to conditions that can be corrected (pod detected as unhealthy)
|
19 |
| - * glog.V(2) - Useful steady state information about the service and important log messages that may correlate to significant changes in the system. This is the recommended default log level for most systems. |
| 19 | + * klog.V(2) - Useful steady state information about the service and important log messages that may correlate to significant changes in the system. This is the recommended default log level for most systems. |
20 | 20 | * Logging HTTP requests and their exit code
|
21 | 21 | * System state changing (killing pod)
|
22 | 22 | * Controller state change events (starting pods)
|
23 | 23 | * Scheduler log messages
|
24 |
| - * glog.V(3) - Extended information about changes |
| 24 | + * klog.V(3) - Extended information about changes |
25 | 25 | * More info about system state changes
|
26 |
| - * glog.V(4) - Debug level verbosity |
| 26 | + * klog.V(4) - Debug level verbosity |
27 | 27 | * Logging in particularly thorny parts of code where you may want to come back later and check it
|
28 |
| - * glog.V(5) - Trace level verbosity |
| 28 | + * klog.V(5) - Trace level verbosity |
29 | 29 | * Context to understand the steps leading up to errors and warnings
|
30 | 30 | * More information for troubleshooting reported issues
|
31 | 31 |
|
|
0 commit comments