An open API service indexing awesome lists of open source software.

https://github.com/qclaogui/lg

Project logger packaging for zap
https://github.com/qclaogui/lg

golang logging zap

Last synced: 6 months ago
JSON representation

Project logger packaging for zap

Awesome Lists containing this project

README

          


lg







License

Project logger packaging for [github.com/uber-go/zap](https://github.com/uber-go/zap)

## Getting Started

Suitable for project log in the container

### Installation

`go get -u github.com/qclaogui/lg`

### Usage [Run in Playground](https://play.golang.org/p/_q67O0B0Dd5)

```go
package main

import (
"github.com/qclaogui/lg"
)

func main() {
//lg.TimeFormat = time.RFC3339Nano

// lvl - global log level: Debug(-1), Info(0), Warn(1), Error(2), DPanic(3), Panic(4), Fatal(5)
_ = lg.Init(-1, "demo-project")

lg.APPLog.Info("Happy Goding!")
}
// Output: {"level":"info","ts":1564834577.710078,"msg":"Happy Goding!","info":{"project":"demo-project","hostname":"qclaogui.local"}}
```

## Versioning

Using [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/qclaogui/lg/tags).

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details