8000 GitHub - Augani/lepora: Go logger with persistence and advance search capabilities
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Augani/lepora

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project logo

Lepora

Status GitHub Issues GitHub Pull Requests License


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/lepora@v0.1.2

🎈 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

✍️ Authors

About

Go logger with persistence and advance search capabilities

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0