This repository has been archived on 2024-04-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
elektron/elektronLogging/loggerChain.go
balandi1 24dbbb208f Flag for Logger Config yaml file name
Removed yaml filename from env.go and added its flag to scheduler.go
2019-11-26 13:08:45 -05:00

28 lines
579 B
Go

package elektronLogging
import (
log "github.com/sirupsen/logrus"
"os"
)
type Logger interface {
SetNext(logType Logger)
Log(logType int, level log.Level, logData log.Fields, message string)
CreateLogFile(prefix string)
}
type LoggerImpl struct {
Type int
AllowOnConsole bool
LogFile *os.File
next Logger
}
func (l *LoggerImpl) SetNext(logType Logger) {
l.next = logType
}
func (l *LoggerImpl) Log(logType int, level log.Level, logData log.Fields, message string) {
if l.next != nil {
l.next.Log(logType, level, logData, message)
}
}