Skip to content

anastalaz/log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log

Simple colored logging for Go programs. No dependencies and under 40 lines of code.

Info

The package implements 3 loggers with Lshortfile set for easier debugging:

  • log.Info - Color: green - Output: stdout
  • log.Debug - Color: cyan - Output: stdout
  • log.Error - Color: red - Output: stderr

Example

package main

import (
	"errors"
	"github.com/anastalaz/log"
)

func main() {
	log.Debugger = true

	log.Info("App initialized")
	log.Debug("Some", "info", "for you")

	err := errors.New("Something bad happened")
	if err != nil {
		log.Error(err)
	}
}

output

NOTICE: If log.Debugger is not set debug logs will not print

License

MIT

About

Simple colored logging for Go programs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages