Skip to content

Simple and easy to use custom logger with json support

Notifications You must be signed in to change notification settings

tim-koehler/tims-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple and easy to use custom logger with json support

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages