1 Star 1 Fork 2

allan577/go-lib-logger

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

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

go get -u -v gitee.com/allan577/go-lib-logger

Usage

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

空文件

简介

暂无描述 展开 收起
README
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

语言

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/allan577/go-lib-logger.git
git@gitee.com:allan577/go-lib-logger.git
allan577
go-lib-logger
go-lib-logger
v1.0.0

搜索帮助