Add log Format option

This commit is contained in:
Asim Aslam
2019-12-19 12:20:33 +00:00
parent d52a111735
commit 2bcfb85613
3 changed files with 26 additions and 3 deletions

View File

@@ -10,6 +10,8 @@ var (
DefaultSize = 1024
// DefaultLog logger
DefaultLog = NewLog()
// Default formatter
DefaultFormat = func(r Record) string { return r.Message.(string) }
)
// Log is debug log interface for reading and writing logs
@@ -37,3 +39,6 @@ type Stream interface {
Chan() <-chan Record
Stop() error
}
// Format is a function which formats the output
type FormatFunc func(Record) string