# README
Go LOggering Framework
Features and TODOs
-
Entry -> Handler... -> Logger architecture where Logger runs in a separate goroutine and allows asynchronous logging.
-
Flexible handlers that can broadcast and forward logging events to logger in different condition.
-
Multi-goroutine safe handlers that can change event route condition online.
-
Support file based output and rotate with lumberjack, response to os.Signal for triggered rotate.
-
Support network output with file based spooling.
-
Console formatter
- Colorized.
- Call stack print.
- Calling position (file:line).
- Line-bufferred output.
Example
import (
"github.com/jamesruan/golf"
"github.com/jamesruan/golf/event"
)
func main() {
logger := golf.DefaultEntry
logger.Infof("Hello, World!")
topic_logger := golf.NewTopicEntry("mytopic", golf.DefaultSink)
topic_logger.Infof("log with topic")
field_logger := topic_logger.WithFields(event.Field{
Name: "field",
Value: "field_value",
})
field_logger.Infof("log with field")
field_logger.Fatalf("make sure log is flushed")
}
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
used for signalling the logger to flush and rotate when the logger implements logger.RotateLogger.
# Structs
DirectSink sinks event with Formatter and sink the bytes direct into the Logger.
No description provided by the author
StreamSink sinks event with Formatter and sink the bytes into bufferred stream.
No description provided by the author
# Interfaces
No description provided by the author