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 ef6d154d06 Refactoring Code
Renamed PcpLogger, SetLogFile(), LogFileName. Changed error messages in loggerConfig.
2019-11-26 12:48:48 -05:00

28 lines
575 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)
}
}