Skip to content

Commit

Permalink
chore: sync automaxprocs logging with upstream Caddy
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Dec 20, 2023
1 parent afb794b commit 3ac0042
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions caddy/mercure/main.go
Expand Up @@ -6,18 +6,19 @@ import (
caddycmd "github.com/caddyserver/caddy/v2/cmd"

"go.uber.org/automaxprocs/maxprocs"
"go.uber.org/zap"

// plug in Caddy modules here.
_ "github.com/caddyserver/caddy/v2/modules/standard"
_ "github.com/dunglas/mercure/caddy"
)

//nolint:gochecknoinits
func init() {
//nolint:errcheck
maxprocs.Set(maxprocs.Logger(caddy.Log().Sugar().Debugf))
}

func main() {
undo, err := maxprocs.Set()
defer undo()
if err != nil {
caddy.Log().Warn("failed to set GOMAXPROCS", zap.Error(err))
}

caddycmd.Main()
}

0 comments on commit 3ac0042

Please sign in to comment.