# README
Lepora
The best logger fo your project written in Go, with support for postgres and mongodb persistence.
📝 Table of Contents
🧐 About
This is a logger that has support for local file writes and database persistence. It has additional dashboards for viewing logs in a web browser.
🏁 Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Prerequisites
A system running go. You can check if you have go on your system by running
go version
Installing
Run
go get github.com/augani/[email protected]
🎈 Usage
package main
import (
"github.com/augani/lepora"
)
func main(){
lep, err := lepora.Setup(lepora.LeporaOptions{
// Options
// Local means a local file will be created for logging
Method: lepora.Local,
//Name is your app name that will be used to name the log file
Name: "AppTest",
// Max size is the maximum size of the log file in bytes
MaxSize: 1024,
// Max files is the maximum number of log files you want to have
MaxFiles: 5,
// max days is the maximum number of days you want to keep logs for
MaxDays: 7,
// Debug is a boolean that determines if you want to log debug messages
Debug: true,
})
if err != nil {
panic(err)
}
lep.Log("key", "value", "key2", "value2")
// Logs will be in key value pairs of any number
}
⛏️ Built Using
- Go - Go
✍️ Authors
- @augani - Idea & Initial work