Coder Social home page Coder Social logo

goseaslog's Introduction

goSeasLog

是一个模拟php Seaslog 的一个go实现日志输出库

	_logger := goSeasLog.New()
	
	//第一个参数为空,将不会把日志输出到文件
    //第二个参数是时间format,用于切分文件
    //第三个参数 true 将把不同级别的日志再分别切分
    // _logger.SetLogFile("./logs/", "200601021504", true)
    // _logger.SetLogFile("./logs/", "200601021504", false)
    _logger.SetLogFile("./logs/", "2006010215", true)

	//是否输出到终端
	_logger.SetTerminalOut(false)
	_logger.SetLevel(goSeasLog.Debug)
	_logger.SetDateFormat("2006/1/2 15:04:05") 
	_logger.SetGap(" & ")
	
	//调整占位符位置
	_logger.SetLogFormat("%L %P %T %Q %H %F %M")
	_logger.SetHostName("imeiren.com")

	_logger.Debug("aabb", 1, 3, i)
	_logger.Debug("aabb", 1, 3, i, _lint, _lint2)
	_logger.Info("aabb", 1, 3, i)
	_logger.Info("aabb", 1, 3, i, _lint, _lint2)
	_logger.Warn("aabb", 1, 3, i)
	_logger.Warn("aabb", 1, 3, i, _lint, _lint2)
	_logger.Error("aabb", 1, 3, i)
	_logger.Error("aabb", 1, 3, i, _lint, _lint2)

goseaslog's People

Stargazers

 avatar

Watchers

 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.