|
@@ -109,6 +109,18 @@ func (o *Output) Write(p []byte) (n int, err error) {
|
|
|
return len(p), firstErr
|
|
|
}
|
|
|
|
|
|
+func (o *Output) Flush() {
|
|
|
+ o.Mutex.Lock()
|
|
|
+ defer o.Mutex.Unlock()
|
|
|
+ for _, dst := range o.dests {
|
|
|
+ if f, ok := dst.(interface {
|
|
|
+ Flush()
|
|
|
+ }); ok {
|
|
|
+ f.Flush()
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// Close unregisters all destinations and waits for all background
|
|
|
// AddTail and AddString tasks to complete.
|
|
|
// The Close method of each destination is called if it exists.
|