Skip to content

Commit

Permalink
httpsvr: SetLogger also set http.Server.ErrorLog (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshineplan committed Dec 18, 2023
1 parent c32da26 commit 7310caf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions httpsvr/httpsvr.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ func New() *Server {
return &Server{Server: &http.Server{}, Logger: log.Default()}
}

func (s *Server) SetLogger(logger *log.Logger) {
s.Logger = logger
s.Server.ErrorLog = logger.Logger
}

func (s *Server) SetReload(d time.Duration) {
s.reload = d
}
Expand Down

0 comments on commit 7310caf

Please sign in to comment.