feat(Logger): ConsoleLogger filepath now changeable from code

This commit is contained in:
2024-10-26 15:28:35 +02:00
parent e8a5be21d3
commit 6f459eff45
2 changed files with 14 additions and 5 deletions

View File

@@ -7,8 +7,16 @@ import (
"time"
)
func (lgr *FileLoggerImpl) SetLogFilePath(path string) {
lgr.initfilepath = path
}
func (lgr *FileLoggerImpl) init() {
lgr.filepath = "./log"
if lgr.initfilepath == "" {
lgr.filepath = "./log"
} else {
lgr.filepath = lgr.initfilepath
}
lgr.messages = make(chan string, Logbuffersize)
envfp, envexist := os.LookupEnv("LOGFILE_GO_LOGGER")
if envexist {