Skip to content

Commit

Permalink
add logs config to config struct
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM committed Feb 7, 2024
1 parent 151562f commit 9c61b50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ethtxmanager/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ethtxmanager
import (
"github.com/0xPolygonHermez/zkevm-ethtx-manager/config/types"
"github.com/0xPolygonHermez/zkevm-ethtx-manager/etherman"
"github.com/0xPolygonHermez/zkevm-ethtx-manager/log"
"github.com/ethereum/go-ethereum/common"
)

Expand Down Expand Up @@ -60,4 +61,7 @@ type Config struct {
PersistenceFilename string `mapstructure:"PersistenceFilename"`
// Etherman configuration
Etherman etherman.Config `mapstructure:"Etherman"`

// Log configuration
Log log.Config `mapstructure:"Log"`
}
3 changes: 1 addition & 2 deletions test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ var (
)

func main() {
log.Init(log.Config{Level: "info", Environment: "development", Outputs: []string{"stderr"}})

config := ethtxmanager.Config{
FrequencyToMonitorTxs: types.Duration{Duration: 1 * time.Second},
WaitTxToBeMined: types.Duration{Duration: 2 * time.Minute},
Expand All @@ -35,6 +33,7 @@ func main() {
MultiGasProvider: false,
L1ChainID: 1337,
},
Log: log.Config{Level: "info", Environment: "development", Outputs: []string{"stderr"}},
}
log.Debug("Creating ethtxmanager")
client, err := ethtxmanager.New(config)
Expand Down

0 comments on commit 9c61b50

Please sign in to comment.