Skip to content
This repository was archived by the owner on May 19, 2020. It is now read-only.

microparts/logs-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is DEPRECATED! Use https://github.com/spacetab-io/logs-go instead.

logs-go

CircleCI codecov

Logrus wrapper for easy use with sentry hook, database (gorm) and mux (gin) loggers.

Usage

Initiate new logger with prefilled logs.Config and use it as common logrus logger instance

package main

import (
	"time"
	
	"github.com/microparts/logs-go"
)

func main() {
	conf := &logs.Config{
		Level:"warn",
		Format: "text",
		Sentry: &logs.SentryConfig{
			Enable: true,
			Stage:"test",
			DSN: "http://dsn.sentry.com",
			ResponseTimeout: 0,
			StackTrace: logs.StackTraceConfig{
				Enable: true,
			},
		},
	}
	
	l, err := logs.NewLogger(conf)
	if err != nil {
		panic(err)
	}
	
	l.Warn("log some warning")
}

Licence

The software is provided under MIT Licence.

About

golang logging package

Topics

Resources

License

Stars

1 star

Watchers

2 watching

Forks

Packages

 
 
 

Contributors

Languages