GithubHelp home page GithubHelp logo

ylogger's Introduction

ylogger

通用日志类

此日志类打印日志信息到控制台, 包含关键字的颜色显示

形如

[TRACE] 2016/09/12 15:32:41.904046 default.go:19: worker.exec [[php /home/xiaoju/webroot/test.php  ]]

日志级别:

  • trace
  • info
  • warning
  • error
  • debug

其中每个级别都可以进行Enable和Disable(默认每个级别都是开启显示的)

ylogger.Disable("debug")

具体使用例子:

import "github.com/jianfengye/ylogger"

ylogger.Warning("job.nextTime", this.Id, "timeing is empty")
ylogger.Trace("job.nextTime", this.Id)

调用函数第一个参数为分类,为了能分类出需要的错误信息

从第二个参数到后面的参数为可变参数

更多使用例子可以参考 logger_test.go

ylogger's People

Contributors

jianfengye avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.