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
- Host: GitHub
- URL: https://github.com/qclaogui/lg
- Owner: qclaogui
- License: mit
- Created: 2019-08-02T15:39:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-11T12:52:32.000Z (almost 7 years ago)
- Last Synced: 2024-06-20T04:01:54.966Z (about 2 years ago)
- Topics: golang, logging, zap
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
lg
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