Skip to content

davidmz/debug-log

Repository files navigation

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
}

About

A thin logger inspired by the NPM's debug

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages