diff --git a/server/config/config.go b/server/config/config.go index 2250de3d98476cc82e8e5d6e815b39a2442b0d9f..79cc867f4c2c3fdfbe18f81dff9a5c544f8b44fe 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -22,6 +22,7 @@ type Config struct { Port int `env:"SOFT_SERVE_PORT" envDefault:"23231"` KeyPath string `env:"SOFT_SERVE_KEY_PATH"` RepoPath string `env:"SOFT_SERVE_REPO_PATH" envDefault:".repos"` + Debug bool `env:"SOFT_SERVE_DEBUG" envDefault:"false"` InitialAdminKeys []string `env:"SOFT_SERVE_INITIAL_ADMIN_KEY" envSeparator:"\n"` Callbacks Callbacks ErrorLog *glog.Logger @@ -34,6 +35,9 @@ func DefaultConfig() *Config { if err := env.Parse(cfg); err != nil { log.Fatal(err) } + if cfg.Debug { + log.SetLevel(log.DebugLevel) + } if cfg.KeyPath == "" { // NB: cross-platform-compatible path cfg.KeyPath = filepath.Join(".ssh", "soft_serve_server_ed25519")