https://github.com/akaspin/logx
Simple Golang log wrapper
https://github.com/akaspin/logx
logging
Last synced: 29 days ago
JSON representation
Simple Golang log wrapper
- Host: GitHub
- URL: https://github.com/akaspin/logx
- Owner: akaspin
- License: mit
- Created: 2015-05-20T12:34:19.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-01-27T05:16:20.000Z (over 8 years ago)
- Last Synced: 2025-12-17T09:20:45.377Z (7 months ago)
- Topics: logging
- Language: Go
- Size: 164 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logx
[](http://godoc.org/github.com/akaspin/logx)
[](https://travis-ci.org/akaspin/logx)
[](https://codecov.io/gh/akaspin/logx)
[](https://goreportcard.com/report/github.com/akaspin/logx)
Logx is simple and fast logging library designed taking into account to work in the containerized environments.
In the base Logx using go build tags to configure logging level.
## Usage
```go
package main
import "github.com/akaspin/logx"
func main() {
log := logx.GetLog("test")
log.Trace("too chatty")
log.Debug("less chatty")
log.Info("ok")
log.Notice("something serious")
log.Warning("oh")
log.Error("bang")
}
```
By default all trace and debug calls are completely omitted from output:
```shell
$ go run ./main.go
INFO test main.go:10 ok
NOTICE test main.go:11 something serious
WARNING test main.go:12 oh
ERROR test main.go:13 bang
```
To make app extremely chatty use "trace" build tag:
```shell
$ go run -tags=trace ./main.go
TRACE test main.go:8 too chatty
DEBUG test main.go:9 less chatty
INFO test main.go:10 ok
NOTICE test main.go:11 something serious
WARNING test main.go:12 oh
ERROR test main.go:13 bang
```
In opposite to make app quiet use "notice":
```shell
$ go run -tags=notice ./main.go
NOTICE test main.go:11 something serious
WARNING test main.go:12 oh
ERROR test main.go:13 bang
```