Add structured logging and better error handling
This commit is contained in:
1 parent
db4e3c9611
commit
68c7dd76f2
31 files changed
+640
-109
No files matched your search
@@ -23,6 +23,8 @@ type Settings struct {
|
||||
TrustProxyHeaders bool
|
||||
DownloadDir string
|
||||
LibraryRoots []string
|
||||
LogLevel string
|
||||
LogFormat string
|
||||
Defaults preferences.Preferences
|
||||
}
|
||||
|
||||
@@ -36,6 +38,8 @@ func Load() (Settings, error) {
|
||||
SessionTTL: time.Duration(reader.integer("SESSION_TTL_HOURS", 12)) * time.Hour,
|
||||
TrustProxyHeaders: reader.boolean("TRUST_PROXY_HEADERS", false),
|
||||
DownloadDir: filepath.Clean(reader.text("DOWNLOAD_DIR", "/data/downloads")),
|
||||
LogLevel: reader.text("LOG_LEVEL", "info"),
|
||||
LogFormat: reader.text("LOG_FORMAT", "text"),
|
||||
Defaults: preferences.Preferences{
|
||||
MaxConcurrentDownloads: reader.integer("MAX_CONCURRENT_DOWNLOADS", 2),
|
||||
ConnectionsPerDownload: reader.integer("CONNECTIONS_PER_DOWNLOAD", 4),
|
||||
|
||||
Reference in new issue
Block a user