|
6 år sedan | |
---|---|---|
.. | ||
AUTHORS | 6 år sedan | |
HISTORY.md | 6 år sedan | |
LICENSE | 6 år sedan | |
README.md | 6 år sedan | |
doc.go | 6 år sedan | |
golog.go | 6 år sedan | |
integration.go | 6 år sedan | |
level.go | 6 år sedan | |
log.go | 6 år sedan | |
logger.go | 6 år sedan | |
screen.png | 6 år sedan |
golog is a simple, fast and easy-to-use level-based logger written entirely in GoLang.
golog#Fatalf/Errorf/Warnf/Infof/Debugf
Hijack
and Handle
or Intercept
the on-going logs tooio.Writer
io.Reader
and log to the defined output target(s)fatal
,error
, warn
, info
, debug
, or disable
Navigate through _examples and integrations to learn if that fair solution suits your needs.
The only requirement is the Go Programming Language*.
$ go get github.com/kataras/golog
golog is fairly built on top of the pio library, it has no more external dependencies.
package main
import (
"github.com/kataras/golog"
)
func main() {
// Default Output is `os.Stdout`,
// but you can change it:
// golog.SetOutput(os.Stderr)
// Time Format defaults to: "2006/01/02 15:04"
// you can change it to something else or disable it with:
golog.SetTimeFormat("")
// Level defaults to "info",
// but you can change it:
golog.SetLevel("debug")
golog.Println("This is a raw message, no levels, no colors.")
golog.Info("This is an info message, with colors (if the output is terminal)")
golog.Warn("This is a warning message")
golog.Error("This is an error message")
golog.Debug("This is a debug message")
golog.Fatal("Fatal will exit no matter what, but it will also print the log message if logger's Level is >=FatalLevel")
}
test | times ran (large is better) | ns/op (small is better) | B/op (small is better) | allocs/op (small is better) |
---|---|---|---|---|
BenchmarkGologPrint | 10000000 | 3749 ns/op | 890 B/op | 28 allocs/op |
BenchmarkLogrusPrint | 3000000 | 9609 ns/op | 1611 B/op | 64 allocs/op |
Click here for details.
If you find that something is not working as expected please open an issue.
Package | Author | Description |
---|---|---|
iris | Gerasimos Maropoulos | The fastest web framework for Go in (THIS) Earth. HTTP/2 Ready-To-GO. Mobile Ready-To-GO. |
Do not hesitate to put your package on this list via PR!