forked from External/grumble
Output all LogTarget writes to Stderr as well (for now).
This commit is contained in:
parent
79e5ffbd4d
commit
f47840f8fc
1 changed files with 11 additions and 1 deletions
|
|
@ -29,7 +29,17 @@ func (target *LogTarget) Write(in []byte) (int, error) {
|
||||||
target.mu.Lock()
|
target.mu.Lock()
|
||||||
defer target.mu.Unlock()
|
defer target.mu.Unlock()
|
||||||
|
|
||||||
return target.file.Write(in)
|
n, err := os.Stderr.Write(in)
|
||||||
|
if err != nil {
|
||||||
|
return n, err
|
||||||
|
}
|
||||||
|
|
||||||
|
n, err = target.file.Write(in)
|
||||||
|
if err != nil {
|
||||||
|
return n, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return len(in), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenFile opens the main log file for writing.
|
// OpenFile opens the main log file for writing.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue