modulepackage
0.0.0-20240520183506-551f8c29392d
Repository: https://github.com/camelhr/log.git
Documentation: pkg.go.dev
# README
log
This Go module provides wrapper functions for logging and initializing zerolog, a fast and flexible logging library for Go.
How to use
- Import the module into your Go project
get -u github.com/camelhr/log
- Call the
Init(appName)
function insidemain.go
to initialize the logger
# Functions
Debug takes formatted message string and logs at Debug level.
Error takes formatted message string and logs at Error level.
Fatal takes formatted message string, logs at Fatal level and then calls os.Exit(1).
Info takes formatted message string and logs at Info level.
InitGlobalLogger creates a new logger with specified appName and log level It also sets the new logger as built in logger This should be called prior to calling any of the log methods.
Panic takes formatted message string, logs at Panic level and calls panic().
SetOutput updates the current logger's output to specified io.Writer.
Warn takes formatted message string and logs at Warn level.
With returns a new logger with additional context provided by a set of key/value tuples.
# Interfaces
Logger provides common logging functionalities.