fix(Logger)!: consoleLogger and FileLogger StartLogger now automatically start a goroutine when called

This commit is contained in:
2024-10-27 02:29:09 +02:00
parent eb041fd18c
commit 88b3d9fa34
2 changed files with 23 additions and 19 deletions

View File

@@ -12,9 +12,11 @@ func (lgr *ConsoleLoggerImpl) init() {
func (logger *ConsoleLoggerImpl) StartLogger() {
fmt.Println("Starting Logger")
loggerlogonce.Do(func() {
for msg := range logger.messages {
fmt.Print(msg)
}
go func() {
for msg := range logger.messages {
fmt.Print(msg)
}
}()
})
}