Skip to content

Commit

Permalink
StopFlushDaemon: document flushing on shutdown
Browse files Browse the repository at this point in the history
This is how it was originally implemented and people may have started to rely
on that now after inspecting the source code.
  • Loading branch information
pohly committed Mar 21, 2022
1 parent 7179178 commit 47f254f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions klog.go
Expand Up @@ -1077,9 +1077,9 @@ func (f *flushDaemon) isRunning() bool {
return f.stopC != nil
}

// StopFlushDaemon stops the flush daemon, if running.
// StopFlushDaemon stops the flush daemon, if running, and flushes once.
// This prevents klog from leaking goroutines on shutdown. After stopping
// the daemon, you can still manually flush buffers by calling Flush().
// the daemon, you can still manually flush buffers again by calling Flush().
func StopFlushDaemon() {
logging.flushD.stop()
}
Expand Down

0 comments on commit 47f254f

Please sign in to comment.