2019-03-23 23:08:13 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Philipp Haefelfinger (http://www.haefelfinger.ch/). All Rights Reserved.
|
|
|
|
* This application is licensed under GPLv2. See the LICENSE file in the root directory of the project.
|
|
|
|
*/
|
|
|
|
|
2019-02-23 21:57:54 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-03-03 23:34:11 +01:00
|
|
|
"flag"
|
2019-03-03 23:44:13 +01:00
|
|
|
"git.haefelfinger.net/piwigo/PiwigoDirectoryUploader/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
|
|
|
}
|