mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 17:24:26 +08:00
support disable boot log
This commit is contained in:
+8
-3
@@ -39,11 +39,13 @@ func init() {
|
||||
}
|
||||
|
||||
// SetLoggerConfiguration sets the logger according to the config
|
||||
func SetLoggerConfiguration(config *settings.Config) error {
|
||||
func SetLoggerConfiguration(config *settings.Config, isDisableBootLog bool) error {
|
||||
var bootWriters []io.Writer
|
||||
var writers []io.Writer
|
||||
|
||||
bootWriters = append(bootWriters, os.Stdout)
|
||||
if !isDisableBootLog {
|
||||
bootWriters = append(bootWriters, os.Stdout)
|
||||
}
|
||||
|
||||
if config.EnableConsoleLog {
|
||||
writers = append(writers, os.Stdout)
|
||||
@@ -56,7 +58,10 @@ func SetLoggerConfiguration(config *settings.Config) error {
|
||||
return err
|
||||
}
|
||||
|
||||
bootWriters = append(bootWriters, logFile)
|
||||
if !isDisableBootLog {
|
||||
bootWriters = append(bootWriters, logFile)
|
||||
}
|
||||
|
||||
writers = append(writers, logFile)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user