Logger is a go package that provides a simple and easy to use logging interface. It is designed to be used in a variety of applications and provides a simple way to log messages.
go get github.com/RevittConsulting/logger- Simple and easy to use
- Get observed logs for testing
- Loki support
Run this on app startup to enable loki logging.
InitLoggerConfig(&Config{
LokiAddress: "http://localhost:3100",
Labels: map[string]string{"app": "My App", "env": "local"},
UsingLoki: true,
})Add these values to config
loggerCfg := &logger.Config{
LogToFile: true,
LogFilePath: "log.txt",
}
logger.InitLoggerConfig(loggerCfg)Found a bug or want to suggest a feature? Feel free to create an issue or make a pull request.