Add the possiblity to enable debug mode with an environment variable
This commit is contained in:
parent
c8138351c9
commit
23d2d9109f
2 changed files with 6 additions and 1 deletions
|
@ -63,7 +63,7 @@ func Parse() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if *flagDebugMode {
|
if *flagDebugMode || cfg.HasDebugMode() {
|
||||||
logger.EnableDebug()
|
logger.EnableDebug()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,11 @@ func (c *Config) getInt(key string, fallback int) int {
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HasDebugMode returns true if debug mode is enabled.
|
||||||
|
func (c *Config) HasDebugMode() bool {
|
||||||
|
return c.get("DEBUG", "") != ""
|
||||||
|
}
|
||||||
|
|
||||||
// BaseURL returns the application base URL.
|
// BaseURL returns the application base URL.
|
||||||
func (c *Config) BaseURL() string {
|
func (c *Config) BaseURL() string {
|
||||||
return c.get("BASE_URL", defaultBaseURL)
|
return c.get("BASE_URL", defaultBaseURL)
|
||||||
|
|
Loading…
Reference in a new issue