diff --git a/cmd/DirectoriesToAlbums/main.go b/cmd/DirectoriesToAlbums/main.go index 1d04bf8..3a5aed4 100644 --- a/cmd/DirectoriesToAlbums/main.go +++ b/cmd/DirectoriesToAlbums/main.go @@ -1,12 +1,17 @@ package main import ( + "flag" "git.haefelfinger.net/piwigo/DirectoriesToAlbums/internal/app" "github.com/sirupsen/logrus" "github.com/vharitonsky/iniflags" "os" ) +var ( + logLevel = flag.String("logLevel", "info", "The minimum log level required to write out a log message. (panic,fatal,error,warn,info,debug,trace)") +) + func main() { iniflags.Parse() initializeLog() @@ -14,8 +19,13 @@ func main() { } func initializeLog() { - //TODO: make log configurable to file instead of console - logrus.SetLevel(logrus.DebugLevel) + level, err := logrus.ParseLevel(*logLevel) + if err != nil { + level = logrus.DebugLevel + } + logrus.SetLevel(level) + logrus.SetOutput(os.Stdout) + logrus.Infoln("Starting Piwigo directories to albums...") } diff --git a/configs/defaultConfig.ini b/configs/defaultConfig.ini index 0226890..be24634 100644 --- a/configs/defaultConfig.ini +++ b/configs/defaultConfig.ini @@ -2,6 +2,8 @@ allowMissingConfig = false # Don't terminate the app if the ini file cannot be allowUnknownFlags = false # Don't terminate the app if ini file contains unknown flags. configUpdateInterval = 0s # Update interval for re-reading config file set via -config flag. Zero disables config file re-reading. imagesRootPath = # This is the images root path that should be mirrored to piwigo. +logLevel = info # The minimum log level required to write out a log message. (panic,fatal,error,warn,info,debug,trace) piwigoPassword = # This is password to the given username. +piwigoUploadChunkSizeInKB = 512 # The chunksize used to upload an image to piwigo. piwigoUrl = # The root url without tailing slash to your piwigo installation. piwigoUser = # The username to use during sync.