Giter VIP home page Giter VIP logo

logrz's Introduction

logrz

An easy way to log data to terminal in go

Install

go get github.com/Sata51/logrz

Usage

import (
	"github.com/Sata51/logrz"
)

func main() {
	logrz.T("Start!")
	//[ 14:57:34.183 ][ TRACE ][ logrz.TestLogger ] > Start! +52.391µs
	logrz.D("Start!")
	//[ 14:57:34.184 ][ DEBUG ][ logrz.TestLogger ] > Start! +228.062µs
	logrz.I("Start!")
	//[ 14:57:34.184 ][ INFO  ][ logrz.TestLogger ] > Start! +9.855µs
	logrz.W("Start!")
	//[ 14:57:34.184 ][ WARN  ][ logrz.TestLogger ] > Start! +13.144µs
	logrz.E("Start!")
	//[ 14:57:34.184 ][ ERROR ][ logrz.TestLogger ] > Start! +7.501µs
	logrz.F("Start!")
	//[ 14:57:34.184 ][ FATAL ][ logrz.TestLogger ] > Start! +7.206µs
	logrz.P("Start!")
	//[ 14:57:34.184 ][ PANIC ][ logrz.TestLogger ] > Start! +7.263µs

	//Set minimum log level to be print
	//Log level are sorted from Trace > Debug > Info > Warning > Error > Fatal > Panic
	logrz.SetLevel(logrz.ErrorLevel)

	//Disable log color
	logrs.DisableColor(bool)

	//Force the entire line to be colorized
	logrz.ForceFullColor(bool)
}

logrz's People

Contributors

sata51 avatar

Watchers

James Cloos avatar  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.