PiwigoDirectoryUploader/cmd/DirectoriesToAlbums/main.go

32 lines
620 B
Go
Raw Normal View History

2019-02-23 21:57:54 +01:00
package main
import (
2019-03-03 23:34:11 +01:00
"flag"
2019-03-02 00:21:01 +01:00
"git.haefelfinger.net/piwigo/DirectoriesToAlbums/internal/app"
2019-02-23 21:57:54 +01:00
"github.com/sirupsen/logrus"
2019-02-24 23:11:52 +01:00
"github.com/vharitonsky/iniflags"
2019-02-23 21:57:54 +01:00
"os"
)
2019-03-03 23:34:11 +01:00
var (
logLevel = flag.String("logLevel", "info", "The minimum log level required to write out a log message. (panic,fatal,error,warn,info,debug,trace)")
)
2019-02-23 21:57:54 +01:00
func main() {
2019-02-24 23:11:52 +01:00
iniflags.Parse()
2019-03-03 23:21:38 +01:00
initializeLog()
2019-02-24 23:11:52 +01:00
app.Run()
2019-02-23 21:57:54 +01:00
}
2019-03-03 23:21:38 +01:00
func initializeLog() {
2019-03-03 23:34:11 +01:00
level, err := logrus.ParseLevel(*logLevel)
if err != nil {
level = logrus.DebugLevel
}
logrus.SetLevel(level)
2019-02-23 21:57:54 +01:00
logrus.SetOutput(os.Stdout)
2019-03-03 23:34:11 +01:00
2019-02-23 21:57:54 +01:00
logrus.Infoln("Starting Piwigo directories to albums...")
2019-02-23 22:02:12 +01:00
}