1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

config: lowercase log levels for #90

This commit is contained in:
James Hillyerd
2018-04-01 20:50:18 -07:00
parent d1dbcf6e63
commit 8c66a24513
6 changed files with 18 additions and 17 deletions

View File

@@ -3,6 +3,7 @@ package config
import (
"log"
"os"
"strings"
"text/tabwriter"
"time"
@@ -30,7 +31,7 @@ var (
// Root wraps all other configurations.
type Root struct {
LogLevel string `required:"true" default:"INFO" desc:"DEBUG, INFO, WARN, or ERROR"`
LogLevel string `required:"true" default:"info" desc:"debug, info, warn, or error"`
SMTP SMTP
POP3 POP3
Web Web
@@ -86,6 +87,7 @@ type Storage struct {
func Process() (*Root, error) {
c := &Root{}
err := envconfig.Process(prefix, c)
c.LogLevel = strings.ToLower(c.LogLevel)
stringutil.SliceToLower(c.SMTP.AcceptDomains)
stringutil.SliceToLower(c.SMTP.RejectDomains)
stringutil.SliceToLower(c.SMTP.StoreDomains)