Skip to content
Snippets Groups Projects
Commit 23d2d910 authored by Frédéric Guillot's avatar Frédéric Guillot
Browse files

Add the possiblity to enable debug mode with an environment variable

parent c8138351
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,7 @@ func Parse() {
return
}
if *flagDebugMode {
if *flagDebugMode || cfg.HasDebugMode() {
logger.EnableDebug()
}
......
......@@ -48,6 +48,11 @@ func (c *Config) getInt(key string, fallback int) int {
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.
func (c *Config) BaseURL() string {
return c.get("BASE_URL", defaultBaseURL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment