Merge pull request #6196 from CatherineF-dev/patch-1

Add logging header formats in doc
This commit is contained in:
Kubernetes Prow Robot 2021-11-18 09:55:03 -08:00 committed by GitHub
commit 241bb5aad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -38,3 +38,25 @@ Logs generated by `ErrorS` command may be enhanced with additional debug informa
As per the comments, the practical default level is V(2). Developers and QE
environments may wish to run at V(3) or V(4). If you wish to change the log
level, you can pass in `-v=X` where X is the desired maximum level to log.
## Logging header formats
An example logging message is
```
I0528 19:15:22.737538 47512 logtest.go:52] msg...
```
This log line have this form:
```
Lmmdd hh:mm:ss.uuuuuu threadid file:line] msg...
where the fields are defined as follows:
L A single character, representing the log level (eg 'I' for INFO)
mm The month (zero padded; ie May is '05')
dd The day (zero padded)
hh:mm:ss.uuuuuu Time in hours, minutes and fractional seconds
threadid The space-padded thread ID as returned by GetTID()
file The file name
line The line number
msg The user-supplied message
```
See more in [here](https://github.com/kubernetes/klog/blob/9ad246211af1ed84621ee94a26fcce0038b69cd1/klog.go#L581-L597)