Skip to content

Commit d871db8

Browse files
committed
Add option to enable debug mode in config.toml
1 parent 8e761bc commit d871db8

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

cmd/podsync/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ type Log struct {
4848
MaxAge int `toml:"max_age"`
4949
// Compress old backups
5050
Compress bool `toml:"compress"`
51+
// Debug mode
52+
Debug bool `toml:"debug"`
5153
}
5254

5355
// LoadConfig loads TOML configuration from a file path

cmd/podsync/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ func main() {
9292
MaxAge: cfg.Log.MaxAge,
9393
Compress: cfg.Log.Compress,
9494
})
95+
96+
// Optionally enable debug mode from config.toml
97+
if cfg.Log.Debug {
98+
log.SetLevel(log.DebugLevel)
99+
}
95100
}
96101

97102
log.WithFields(log.Fields{

config.toml.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ vimeo = [ # Multiple keys will be rotated.
8282
# Note that setting '--audio-format' for audio format feeds, or '--format' or '--output' for any format may cause
8383
# unexpected behaviour. You should only use this if you know what you are doing, and have read up on youtube-dl's options!
8484
youtube_dl_args = ["--write-sub", "--embed-subs", "--sub-lang", "en,en-US,en-GB"]
85-
85+
8686
# When set to true, podcasts indexers such as iTunes or Google Podcasts will not index this podcast
8787
private_feed = true
8888

@@ -123,3 +123,4 @@ max_size = 50 # MB
123123
max_age = 30 # days
124124
max_backups = 7
125125
compress = true
126+
debug = false

0 commit comments

Comments
 (0)