Skip to content

Commit

Permalink
Add option to enable debug mode in config.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Th0masL committed Jan 2, 2023
1 parent 8e761bc commit d871db8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/podsync/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ type Log struct {
MaxAge int `toml:"max_age"`
// Compress old backups
Compress bool `toml:"compress"`
// Debug mode
Debug bool `toml:"debug"`
}

// LoadConfig loads TOML configuration from a file path
Expand Down
5 changes: 5 additions & 0 deletions cmd/podsync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ func main() {
MaxAge: cfg.Log.MaxAge,
Compress: cfg.Log.Compress,
})

// Optionally enable debug mode from config.toml
if cfg.Log.Debug {
log.SetLevel(log.DebugLevel)
}
}

log.WithFields(log.Fields{
Expand Down
3 changes: 2 additions & 1 deletion config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ vimeo = [ # Multiple keys will be rotated.
# Note that setting '--audio-format' for audio format feeds, or '--format' or '--output' for any format may cause
# unexpected behaviour. You should only use this if you know what you are doing, and have read up on youtube-dl's options!
youtube_dl_args = ["--write-sub", "--embed-subs", "--sub-lang", "en,en-US,en-GB"]

# When set to true, podcasts indexers such as iTunes or Google Podcasts will not index this podcast
private_feed = true

Expand Down Expand Up @@ -123,3 +123,4 @@ max_size = 50 # MB
max_age = 30 # days
max_backups = 7
compress = true
debug = false

0 comments on commit d871db8

Please sign in to comment.