Categorygithub.com/davidmz/debug-log
repositorypackage
1.3.0
Repository: https://github.com/davidmz/debug-log.git
Documentation: pkg.go.dev

# README

debug-log

GoDoc GitHub license

The debug-log Go package (imported as debug) provides a thin logger inspired by the NPM's debug package. It outputs the log messages depending on the DEBUG environment variable.

Example of usage:

package main

import (
	"os"

	"github.com/davidmz/debug-log"
)

func main() {
	_ = os.Setenv("DEBUG", "myproject:*")
	testLogger := debug.NewLogger("myproject:test")

	testLogger.Println("log line")
	// Output: TIMESTAMP [myproject:test] log line
}