Merge pull request #7220 from kubernetes/flush-glug

Flush logs before writing to stdout
pull/7228/head
Medya Ghazizadeh 2020-03-24 21:13:41 -07:00 committed by GitHub
commit 9f15f8d0cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ func T(style StyleEnum, format string, a ...V) {
// String writes a basic formatted string to stdout
func String(format string, a ...interface{}) {
// Flush log buffer so that output order makes sense
glog.Flush()
if outFile == nil {
glog.Warningf("[unset outFile]: %s", fmt.Sprintf(format, a...))
return