// Flush writes all messages to the given writer and clears the list
// of stored messages. Blocks Write function.
Flush writes all messages to the given writer and clears the list
of stored messages. Blocks Write function.
// Flush writes all messages to the given writer and clears the list // of stored messages . Blocks Write function .
func (log *logCache) Flush(writer io.Writer) {
	log.flushing.Lock()
	defer log.flushing.Unlock()
	for _, message := range log.messages {
		writer.Write(message)
	}
	log.messages = [][]byte{}
}
func ( log * logCache ) Flush ( writer io . Writer ) { log . flushing . Lock ( ) defer log . flushing . Unlock ( ) for _ , message := range log . messages { writer . Write ( message ) } log . messages = [ ] [ ] byte { } }
Flush writes all messages to the given writer and clears the list
of stored messages.
Flush writes all messages to the given writer and clears the list of stored messages .