Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion cmd/tx-submit-api-mirror/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"
"os"

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

"github.com/blinklabs-io/tx-submit-api-mirror/api"
"github.com/blinklabs-io/tx-submit-api-mirror/config"
Expand All @@ -30,6 +30,10 @@ var cmdlineFlags struct {
configFile string
}

func logPrintf(format string, v ...any) {
logging.GetLogger().Infof(format, v...)
}

func main() {
flag.StringVar(
&cmdlineFlags.configFile,
Expand Down Expand Up @@ -58,6 +62,14 @@ func main() {
}
}()

// Configure max processes with our logger wrapper, toss undo func
_, err = maxprocs.Set(maxprocs.Logger(logPrintf))
if err != nil {
// If we hit this, something really wrong happened
logger.Errorf(err.Error())
os.Exit(1)
}

// Start API listener
logger.Infof(
"starting API listener on %s:%d",
Expand Down