arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
Merge pull request #586 from hermeznetwork/feature/gindebugviaconfig

Set gin debug mode via config
arnau 17317030+arnaucube@users.noreply.github.com
Thu, 25 Feb 2021 16:57:55 +0100
commit

b269117a3232aded5d5d7432f545ce84ac0d54d1

parent

e14705c13b97f4341c45fceed50ee41f8e7e631d

3 files changed, 9 insertions(+), 0 deletions(-)

jump to
M cli/node/cfg.buidler.toml → cli/node/cfg.buidler.toml

@@ -14,6 +14,7 @@

[Debug] APIAddress = "localhost:12345" MeddlerLogs = true +GinDebugMode = true [StateDB] Path = "/tmp/iden3-test/hermez/statedb"
M config/config.go → config/config.go

@@ -306,6 +306,9 @@ APIAddress string

// MeddlerLogs enables meddler debug mode, where unused columns and struct // fields will be logged MeddlerLogs bool + // GinDebugMode sets Gin-Gonic (the web framework) to run in + // debug mode + GinDebugMode bool } Coordinator Coordinator `validate:"-"` }
M node/node.go → node/node.go

@@ -359,6 +359,11 @@ }

} var nodeAPI *NodeAPI if cfg.API.Address != "" { + if cfg.Debug.GinDebugMode { + gin.SetMode(gin.DebugMode) + } else { + gin.SetMode(gin.ReleaseMode) + } if cfg.API.UpdateMetricsInterval.Duration == 0 { return nil, tracerr.Wrap(fmt.Errorf("invalid cfg.API.UpdateMetricsInterval: %v", cfg.API.UpdateMetricsInterval.Duration))