Skip to content

RevittCo/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logger

License Release

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.


Quick Start

go get github.com/RevittConsulting/logger

Features

  • Simple and easy to use
  • Get observed logs for testing
  • Loki support

Loki Configuration

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,
})

Log to file

Add these values to config

loggerCfg := &logger.Config{
    LogToFile:   true,
    LogFilePath: "log.txt",
}
logger.InitLoggerConfig(loggerCfg)

Contributing

Found a bug or want to suggest a feature? Feel free to create an issue or make a pull request.


About

Logging package for go

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages