Skip to content

hueristiq/hqgolog

Repository files navigation

hqgolog

license maintenance open issues closed issues contribution

A Go(Golang) package to do structured logging.

Installation

go get -v -u github.com/hueristiq/hqgolog

Usage

package main

import (
	"github.com/hueristiq/hqgolog"
	"github.com/hueristiq/hqgolog/formatter"
	"github.com/hueristiq/hqgolog/levels"
)

func main() {
	hqgolog.DefaultLogger.SetMaxLevel(levels.LevelDebug)
	hqgolog.DefaultLogger.SetFormatter(formatter.NewCLI(&formatter.CLIOptions{
		Colorize: true,
	}))


	hqgolog.Print().Msg("Print message")
	hqgolog.Info().Msg("Info message")
	hqgolog.Warn().Msg("Warn message")
	hqgolog.Error().Msg("Error message")
	hqgolog.Fatal().Msg("Fatal message")
}

Contributing

Issues and Pull Requests are welcome! Check out the contribution guidelines.

Licensing

This package is distributed under the MIT license.

Releases

No releases published

Packages

No packages published

Languages