Skip to content

Commit

Permalink
feat: add debug flags
Browse files Browse the repository at this point in the history
  • Loading branch information
fearlessfe committed Dec 16, 2024
1 parent 4b51c2d commit 57b0ada
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmd/shisui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,20 @@ func init() {
app.Action = shisui
app.Flags = slices.Concat(portalProtocolFlags, historyRpcFlags, metricsFlags, debug.Flags)
flags.AutoEnvVars(app.Flags, "SHISUI")

app.Before = func(ctx *cli.Context) error {
flags.MigrateGlobalFlags(ctx)
if err := debug.Setup(ctx); err != nil {
return err
}
flags.CheckEnvVars(ctx, app.Flags, "SHISUI")
return nil
}

app.After = func(ctx *cli.Context) error {
debug.Exit()
return nil
}
}

func main() {
Expand Down

0 comments on commit 57b0ada

Please sign in to comment.