Add debug flag

This commit is contained in:
Maksym Pavlenko
2019-05-09 10:23:06 -07:00
parent 879d35e57b
commit bc41f49123
+5
View File
@@ -33,6 +33,7 @@ type Opts struct {
DynamoFeedsTableName string `long:"dynamo-feeds-table" env:"DYNAMO_FEEDS_TABLE_NAME"`
DynamoPledgesTableName string `long:"dynamo-pledges-table" env:"DYNAMO_PLEDGES_TABLE_NAME"`
RedisURL string `long:"redis-url" required:"true" env:"REDIS_CONNECTION_URL"`
Debug bool `long:"debug" env:"DEBUG"`
}
func main() {
@@ -51,6 +52,10 @@ func main() {
log.WithError(err).Fatal("failed to read configuration")
}
if opts.Debug {
log.SetLevel(log.DebugLevel)
}
database, err := storage.NewDynamo()
if err != nil {
log.WithError(err).Fatal("failed to create database")