mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-19 21:59:59 -08:00
Add panic to logtarget when a consumer hasn't called OpenFile to open the main log file.
This commit is contained in:
parent
f47840f8fc
commit
ede1c7735e
1 changed files with 4 additions and 0 deletions
|
|
@ -29,6 +29,10 @@ func (target *LogTarget) Write(in []byte) (int, error) {
|
|||
target.mu.Lock()
|
||||
defer target.mu.Unlock()
|
||||
|
||||
if target.file == nil {
|
||||
panic("no log file opened")
|
||||
}
|
||||
|
||||
n, err := os.Stderr.Write(in)
|
||||
if err != nil {
|
||||
return n, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue