You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

840 B

GoScope2

The second iteration from where josep left off

A log tracker, with a basic ui.

Requireds golangs gin http framework and web api calls.

Basic Usage

package main

import (
	"github.com/gin-gonic/gin"
	"github.com/lil5/goscope2"
	"gorm.io/driver/sqlite"
	"gorm.io/gorm"
)

func main() {
	db, _ := gorm.Open(sqlite.Open("gorm.db"), &gorm.Config{})
	r := gin.New()
	goscope2.New(goscope2.Config{
		DB: db,
		AllowedApps: map[int32][]string{
			104365: {"localhost:8080"},
		},
		InternalApp: 104365,
		LimitLogs:   3000,
		AuthUser:    "admin",
		AuthPass:    "admin",
	})

	goscope2.AddRoutes(&r.RouterGroup)

	goscope2.Infof("Run info")
	goscope2.Warningf("Run warning")
	goscope2.Errorf("Run error")
	// goscope2.Fatalf("Run fatal")

	r.Run("localhost:8080")
}

License

Mozilla Public License 2.0