prettylog

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: ISC Imports: 9 Imported by: 0

README

Pretty Log

pretty log is a cli tool that format JSON logs to a more readable format.

Installation

go install github.com/tsingshaner/go-pkg/prettylog/cmd/prettylog@latest

Usage

go run server.go | prettylog

this will format the logs from server.go to a more readable format.

You can also specify the log level to filter the logs.

go run server.go -c ./config/app.yml | prettylog -level=info

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONReader

func JSONReader(fns ...util.WithFn[ReaderOptions])

Types

type CLIConfig

type CLIConfig struct {
	Presets    []string
	TimeFormat string
}

func GetCLIArgs

func GetCLIArgs() *CLIConfig

type ReaderOptions

type ReaderOptions struct {
	Formatter    func(formatter.Data, []byte) string
	ErrorHandler func([]byte, error)
}

type UserConfig

type UserConfig struct {
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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