mozlog

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = &MozLogger{
	Output:     os.Stdout,
	LoggerName: "Bouncer",
}

Functions

This section is empty.

Types

type AppLog

type AppLog struct {
	Timestamp  int64
	Type       string
	Logger     string
	Hostname   string `json:",omitempty"`
	EnvVersion string
	Pid        int `json:",omitempty"`
	Severity   int `json:",omitempty"`
	Fields     map[string]interface{}
}

AppLog implements Mozilla logging standard

func NewAppLog

func NewAppLog(loggerName string, msg []byte) *AppLog

NewAppLog returns a loggable struct

func (*AppLog) ToJSON

func (a *AppLog) ToJSON() ([]byte, error)

ToJSON converts a logline to JSON

type MozLogFormatter

type MozLogFormatter struct {
	LoggerName string
}

func (*MozLogFormatter) Format

func (m *MozLogFormatter) Format(entry *logrus.Entry) ([]byte, error)

type MozLogger

type MozLogger struct {
	Output     io.Writer
	LoggerName string
}

MozLogger implements the io.Writer interface

func (*MozLogger) Write

func (m *MozLogger) Write(l []byte) (int, error)

Write converts the log to AppLog

Jump to

Keyboard shortcuts

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