logo

package module
v0.0.0-...-836e728 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 1 Imported by: 22

README

Wrapper aroung logurus which allows you to set entry without need to maintain the global variable

Before

package logA
var LogrusEntry *logrus.Entry
func init() {
	LogrusEntry = logrus.New().WithFields(logrus.Fields{"app","test"})
}
package main
import xyz.com/xyz/logA
func main() {
	logA.LogrusEntry.Info("Hello world")
}

After

package logA
import github.com/MyriadFlow/cosmos-wallet/helpers/logo
func init() {
	logrusEntry = logrus.New().WithFields(logrus.Fields{"app","test"})
    logo.SetInstance(logrusEntry)
}
package main
import github.com/MyriadFlow/cosmos-wallet/helpers/logo
func main() {
	logo.Info("Hello world")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(args ...interface{})

func ErrorWField

func ErrorWField(err error, args ...interface{})

Logs with error field

func Errorf

func Errorf(format string, args ...interface{})

func ErrorfWField

func ErrorfWField(format string, err error, args ...interface{})

Logs with formatting and error field

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(format string, args ...interface{})

func Info

func Info(args ...interface{})

func Infof

func Infof(format string, args ...interface{})

func SetInstance

func SetInstance(logrusEntry logrus.Entry)

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(format string, args ...interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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