mozlog: Index | Files

package mozlog

import ""


Package Files



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

func Hostname Uses

func Hostname() string

type AppLog Uses

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 Uses

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

NewAppLog returns a loggable struct

func (*AppLog) ToJSON Uses

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

ToJSON converts a logline to JSON

type MozLogger Uses

type MozLogger struct {
    Output     io.Writer
    LoggerName string

MozLogger implements the io.Writer interface

func (*MozLogger) Write Uses

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

Write converts the log to AppLog

Package mozlog imports 7 packages (graph) and is imported by 4 packages. Updated 2017-02-25. Refresh now. Tools for package owners.