Documentation ¶
Index ¶
Constants ¶
View Source
const ( AccessAccepted = AccessStatus("accepted") AccessRejected = AccessStatus("rejected") )
Variables ¶
Functions ¶
Types ¶
type AccessMessage ¶
type AccessMessage struct { From interface{} To interface{} Status AccessStatus Reason interface{} }
func (*AccessMessage) String ¶
func (m *AccessMessage) String() string
type GeneralMessage ¶
type GeneralMessage struct { Severity Severity Content interface{} }
GeneralMessage is a general log message that can contain all kind of content.
type Handler ¶
type Handler interface {
Handle(msg Message)
}
Handler is the interface for log handler.
func NewLogger ¶
func NewLogger(logWriterCreator WriterCreator) Handler
NewLogger returns a generic log handler that can handle all type of messages.
type Message ¶
type Message interface {
String() string
}
Message is the interface for all log messages.
type Writer ¶
Writer is the interface for writing logs.
type WriterCreator ¶
type WriterCreator func() Writer
WriterCreator is a function to create LogWriters.
func CreateFileLogWriter ¶
func CreateFileLogWriter(path string) (WriterCreator, error)
CreateFileLogWriter returns a LogWriterCreator that creates LogWriter for the given file.
func CreateStdoutLogWriter ¶
func CreateStdoutLogWriter() WriterCreator
CreateStdoutLogWriter returns a LogWriterCreator that creates LogWriter for stdout.
Click to show internal directories.
Click to hide internal directories.