Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.19 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.19 KB

TimsLogger Tests Coverage Status Go Report Card

A logger build for my personal needs. Maybe you will also enjoy it :)

Install

go get -u github.com/tim-koehler/tims-logger

Example

package main

import logger "github.com/tim-koehler/tims-logger"

func main() {
	logger.SetColoredLogs(true)
	logger.SetLogLevel(logger.DEBUG.String())

	// TEXT Logging
	logger.SetLogType(logger.TEXT.String()) // logger.SetLogType("TEXT")
	logger.Debugln("Debug log")
	logger.Infoln("Info log")
	logger.Warningln("Warning log")
	logger.Errorln("Error log")

	// JSON Logging
	logger.SetLogType(logger.JSON.String()) // logger.SetLogType("JSON")
	logger.Debugln("Some error")
	logger.Infoln(logger.Custom{
		"foo": "bar",
		"baz": 123,
	})
}

image