logger

package module
v0.0.0-...-d7899d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2020 License: MIT Imports: 7 Imported by: 17

README

BUTTON LOGGER

Usage:

env DSN - sentry token

func init() {
	if err := logger.InitLogger(os.Getenv("DSN")); err != nil {
	       log.Fatal(err)
	}
}

Log some info(not error) to sentry:

logger.SendMessage("Successfully updated!")

Log some info to stdout:

logger.Info("Successfully updated!")

Log errors:

logger.Error("GetBalance", err.Error(), logger.Params{
	       "currency": "ETH",
                ...
})

Thanks for the core of the logger to the TRUST WALLET team !!!

https://github.com/trustwallet/blockatlas

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Error

func Error(args ...interface{})

func Fatal

func Fatal(args ...interface{})

func HandlerError

func HandlerError(handlerName string, err error)

func Info

func Info(args ...interface{})

func InitLogger

func InitLogger(dsn string) error

func InitSentry

func InitSentry(dsn string) error

func LogRequest

func LogRequest(stop time.Duration, currency, request string, mustBeLogged bool)

func Panic

func Panic(args ...interface{})

func SendError

func SendError(err error)

func SendFatal

func SendFatal(err error)

func SendMessage

func SendMessage(msg string)

func Warn

func Warn(args ...interface{})

Types

type Err

type Err struct {
	Message string
	Params  map[string]interface{}
	Err     error
}

func (*Err) Error

func (e *Err) Error() string

type Msg

type Msg struct {
	Message string
	Params  map[string]interface{}
}

func (*Msg) String

func (msg *Msg) String() string

type Params

type Params map[string]interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL