# go-lib-logger **Repository Path**: allan577/go-lib-logger ## Basic Information - **Project Name**: go-lib-logger - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 2 - **Created**: 2021-04-11 - **Last Updated**: 2022-06-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## About ## This package is a library of go project. This is a zero-dependency standard JSON log library that supports structured JSON logs and is compatible with the standard library. - Flexible and controllable caller report. - Support 7 log levels. - Complete log standard library compatibility. - Chained call, supporting additional log context data. - Flexible log hook support. - Custom log formatter support. ## Install ## ```sh go get -u -v gitee.com/allan577/go-lib-logger ``` ## Usage ## ```go package main import ( "gitee.com/allan577/go-lib-logger" ) func main() { // Creates a logger instance with the specified name. log := logger.New("test") // {"level":"info","message":"Something happened.","name":"test","time":"2020-02-20T20:20:20+08:00"} log.Info("Something happened.") // {"fields":{"num":1},"level":"info","message":"Something happened.","name":"test","time":"2020-02-20T20:20:20+08:00"} log.WithField("num", 1).Info("Something happened.") } ``` ## License ## [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)