File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import (
2121 _ "net/http/pprof"
2222 "os"
2323
24- _ "go.uber.org/automaxprocs"
24+ "go.uber.org/automaxprocs/maxprocs "
2525
2626 "github.com/blinklabs-io/tx-submit-api/internal/api"
2727 "github.com/blinklabs-io/tx-submit-api/internal/config"
@@ -33,6 +33,10 @@ var cmdlineFlags struct {
3333 configFile string
3434}
3535
36+ func logPrintf (format string , v ... any ) {
37+ logging .GetLogger ().Infof (format , v ... )
38+ }
39+
3640func main () {
3741 flag .StringVar (
3842 & cmdlineFlags .configFile ,
@@ -63,6 +67,14 @@ func main() {
6367
6468 logger .Infof ("starting tx-submit-api %s" , version .GetVersionString ())
6569
70+ // Configure max processes with our logger wrapper, toss undo func
71+ _ , err = maxprocs .Set (maxprocs .Logger (logPrintf ))
72+ if err != nil {
73+ // If we hit this, something really wrong happened
74+ logger .Errorf (err .Error ())
75+ os .Exit (1 )
76+ }
77+
6678 // Start debug listener
6779 if cfg .Debug .ListenPort > 0 {
6880 logger .Infof (
You can’t perform that action at this time.
0 commit comments