Skip to content

Commit

Permalink
Some debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
e-asphyx committed Jun 20, 2024
1 parent e22328f commit a0516dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
listen: :8080
url: https://ghostnet.ecadinfra.com
chain_id: NetXnHfVqm9iesp
url: http://10.100.20.44
chain_id: NetXXWAHLEvre9b
11 changes: 10 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ const (
defaultReconnectDelay = 10 * time.Second
)

type debugLogger log.Logger

func (l *debugLogger) Printf(format string, a ...any) {
(*log.Logger)(l).Debugf(format, a...)
}

func main() {
logLevel := flag.String("l", "info", "Log level: [error, warn, info, debug, trace]")
confPath := flag.String("c", "", "Config file path")
Expand Down Expand Up @@ -53,9 +59,12 @@ func main() {
if err := yaml.Unmarshal(buf, &conf); err != nil {
log.Fatal(err)
}
tmp, _ := json.MarshalIndent(&conf, "", " ")
log.Info(string(tmp))

cl := client.Client{
URL: conf.URL,
URL: conf.URL,
DebugLogger: (*debugLogger)(log.StandardLogger()),
}

mon := HeadMonitor{
Expand Down

0 comments on commit a0516dd

Please sign in to comment.