Categorygithub.com/Yacast/zap-parser
modulepackage
0.0.0-20190910221712-cf1af1579b12
Repository: https://github.com/yacast/zap-parser.git
Documentation: pkg.go.dev

# README

Documentation

zap-parser

A golang parser for Uber's zap logger json output.

Quick Start

import (
    // ...
    "fmt"

	"github.com/Yacast/zap-parser"
)

p, err := zapparser.FromFile("/path/to/logs"))
if err != nil {
	panic(err)
}

p.OnError(func(err error) {
    fmt.Println(err)
})

p.OnEntry(func(e *zapparser.Entry) {
    fmt.Println(e.Message)
})

p.Start()
fmt.Println("Done parsing...")

# Functions

FromFile creates a new scanner from a byte slice.
FromFile creates a new scanner from a file path.
FromString creates a new scanner from a string.
NewParser creates a new parser.

# Structs

Entry
Entry is a log entry.
Parser holds the zap logs parser.