hq-go-logger
is a Go(Golang) package for structured logging.
go get -v -u go.source.hueristiq.com/logger
Below are examples demonstrating how to use the different features of the hq-go-logger
package.
package main
import (
"go.source.hueristiq.com/logger"
"go.source.hueristiq.com/logger/formatter"
"go.source.hueristiq.com/logger/levels"
)
func main() {
logger.DefaultLogger.SetMaxLevel(levels.LevelDebug)
logger.DefaultLogger.SetFormatter(formatter.NewCLI(&formatter.CLIOptions{
Colorize: true,
}))
logger.Print().Msg("Print message")
logger.Info().Msg("Info message")
logger.Warn().Msg("Warn message")
logger.Error().Msg("Error message")
logger.Fatal().Msg("Fatal message")
}
Feel free to submit Pull Requests or report Issues. For more details, check out the contribution guidelines.
Huge thanks to the contributors thus far!
This package is licensed under the MIT license. You are free to use, modify, and distribute it, as long as you follow the terms of the license. You can find the full license text in the repository - Full MIT license text.