Removed everything related to logToStdout.
This commit is contained in:
parent
b50c411922
commit
36ecd3cf10
@ -14,7 +14,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var configPath *string = flag.String("conf", "config.yaml", "path to configuration file")
|
var configPath *string = flag.String("conf", "config.yaml", "path to configuration file")
|
||||||
var logToStdout *bool = flag.Bool("log-stdout", false, "write logs to stdout")
|
|
||||||
var showVersion *bool = flag.Bool("v", false, "show version")
|
var showVersion *bool = flag.Bool("v", false, "show version")
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -30,17 +29,13 @@ func main() {
|
|||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if *logToStdout {
|
logErr, err := logging.New(config.Log.CleanError)
|
||||||
config.Log.ToStdout = true
|
|
||||||
}
|
|
||||||
|
|
||||||
logErr, err := logging.NewLogger(config.Log.CleanError, config.Log.ToStdout)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln("failed to open error logger:", err)
|
log.Fatalln("failed to open error logger:", err)
|
||||||
}
|
}
|
||||||
defer logErr.Close()
|
defer logErr.Close()
|
||||||
|
|
||||||
logClean, err := logging.NewLogger(config.Log.Clean, config.Log.ToStdout)
|
logClean, err := logging.New(config.Log.Clean)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln("failed to open error logger:", err)
|
log.Fatalln("failed to open error logger:", err)
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var configPath *string = flag.String("conf", "config.yaml", "path to configuration file")
|
var configPath *string = flag.String("conf", "config.yaml", "path to configuration file")
|
||||||
var logToStdout *bool = flag.Bool("log-stdout", false, "write logs to stdout")
|
|
||||||
var showVersion *bool = flag.Bool("v", false, "show version")
|
var showVersion *bool = flag.Bool("v", false, "show version")
|
||||||
|
|
||||||
var version string
|
var version string
|
||||||
@ -40,29 +39,25 @@ func main() {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if *logToStdout {
|
logErr, err := logging.New(config.Log.Error)
|
||||||
config.Log.ToStdout = true
|
|
||||||
}
|
|
||||||
|
|
||||||
logErr, err := logging.NewLogger(config.Log.Error, config.Log.ToStdout)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln("error logger:", err)
|
log.Fatalln("error logger:", err)
|
||||||
}
|
}
|
||||||
defer logErr.Close()
|
defer logErr.Close()
|
||||||
|
|
||||||
logUpload, err := logging.NewLogger(config.Log.Upload, config.Log.ToStdout)
|
logUpload, err := logging.New(config.Log.Upload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln("upload logger:", err)
|
log.Fatalln("upload logger:", err)
|
||||||
}
|
}
|
||||||
defer logUpload.Close()
|
defer logUpload.Close()
|
||||||
|
|
||||||
logDownload, err := logging.NewLogger(config.Log.Download, config.Log.ToStdout)
|
logDownload, err := logging.New(config.Log.Download)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln("download logger:", err)
|
log.Fatalln("download logger:", err)
|
||||||
}
|
}
|
||||||
defer logDownload.Close()
|
defer logDownload.Close()
|
||||||
|
|
||||||
logDelete, err := logging.NewLogger(config.Log.Delete, config.Log.ToStdout)
|
logDelete, err := logging.New(config.Log.Delete)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln("delete logger:", err)
|
log.Fatalln("delete logger:", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user