Back to

Package mozlog

v0.0.0 (4bb1313)
Latest Go to latest
Published: Feb 22, 2017 | License: MPL-2.0 | Module:


Package Files


var Logger = &MozLogger{
	Output:     os.Stdout,
	LoggerName: "Application",

func Hostname

func Hostname() string

type AppLog

type AppLog struct {
	Timestamp  int64
	Time       string
	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 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

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier