Skip to content

Commit

Permalink
fix(logwriter): remove error return
Browse files Browse the repository at this point in the history
I was going to return an error, but I prefer a
panic here, because it's indicative of bad
code, not bad input.
  • Loading branch information
Jaeiya committed Jun 4, 2024
1 parent 6294a07 commit d639aa3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/writers/log_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,12 @@ func (logger) Error(name string, messages ...any) {
log(name, ERROR, messages...)
}

func (logger) Close(name string) error {
func (logger) Close(name string) {
f, ok := logs[name]
if !ok {
panic(fmt.Errorf("log not found: %s", name))
}
f.Close()
return nil
}

func log(name string, level LogLevel, messages ...any) {
Expand Down

0 comments on commit d639aa3

Please sign in to comment.