mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Merge pull request #586 from hermeznetwork/feature/gindebugviaconfig
Set gin debug mode via config
This commit is contained in:
@@ -14,6 +14,7 @@ Type = "bitfinexV2"
|
|||||||
[Debug]
|
[Debug]
|
||||||
APIAddress = "localhost:12345"
|
APIAddress = "localhost:12345"
|
||||||
MeddlerLogs = true
|
MeddlerLogs = true
|
||||||
|
GinDebugMode = true
|
||||||
|
|
||||||
[StateDB]
|
[StateDB]
|
||||||
Path = "/tmp/iden3-test/hermez/statedb"
|
Path = "/tmp/iden3-test/hermez/statedb"
|
||||||
|
|||||||
@@ -306,6 +306,9 @@ type Node struct {
|
|||||||
// MeddlerLogs enables meddler debug mode, where unused columns and struct
|
// MeddlerLogs enables meddler debug mode, where unused columns and struct
|
||||||
// fields will be logged
|
// fields will be logged
|
||||||
MeddlerLogs bool
|
MeddlerLogs bool
|
||||||
|
// GinDebugMode sets Gin-Gonic (the web framework) to run in
|
||||||
|
// debug mode
|
||||||
|
GinDebugMode bool
|
||||||
}
|
}
|
||||||
Coordinator Coordinator `validate:"-"`
|
Coordinator Coordinator `validate:"-"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -359,6 +359,11 @@ func NewNode(mode Mode, cfg *config.Node) (*Node, error) {
|
|||||||
}
|
}
|
||||||
var nodeAPI *NodeAPI
|
var nodeAPI *NodeAPI
|
||||||
if cfg.API.Address != "" {
|
if cfg.API.Address != "" {
|
||||||
|
if cfg.Debug.GinDebugMode {
|
||||||
|
gin.SetMode(gin.DebugMode)
|
||||||
|
} else {
|
||||||
|
gin.SetMode(gin.ReleaseMode)
|
||||||
|
}
|
||||||
if cfg.API.UpdateMetricsInterval.Duration == 0 {
|
if cfg.API.UpdateMetricsInterval.Duration == 0 {
|
||||||
return nil, tracerr.Wrap(fmt.Errorf("invalid cfg.API.UpdateMetricsInterval: %v",
|
return nil, tracerr.Wrap(fmt.Errorf("invalid cfg.API.UpdateMetricsInterval: %v",
|
||||||
cfg.API.UpdateMetricsInterval.Duration))
|
cfg.API.UpdateMetricsInterval.Duration))
|
||||||
|
|||||||
Reference in New Issue
Block a user