jsonlogs

package
v0.0.0-...-2741532 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	PrintlnFn func(...interface{})
	// contains filtered or unexported fields
}

Client is the logger client, to instantiate it call `New()`

func New

func New(level string, parsers ...ContextParser) Client

New builds a logger Client on the appropriate log level

func (Client) Debug

func (c Client) Debug(ctx context.Context, title string, valueMaps ...log.Body)

Debug logs an entry on level "DEBUG" with the received title along with all the values collected from the input valueMaps and the context.

func (Client) Error

func (c Client) Error(ctx context.Context, title string, valueMaps ...log.Body)

Error logs an entry on level "ERROR" with the received title along with all the values collected from the input valueMaps and the context.

func (Client) Fatal

func (c Client) Fatal(ctx context.Context, title string, valueMaps ...log.Body)

Fatal logs an entry on level "ERROR" with the received title along with all the values collected from the input valueMaps and the context.

After that it proceeds to exit the program with code 1.

func (Client) Info

func (c Client) Info(ctx context.Context, title string, valueMaps ...log.Body)

Info logs an entry on level "INFO" with the received title along with all the values collected from the input valueMaps and the context.

func (Client) Warn

func (c Client) Warn(ctx context.Context, title string, valueMaps ...log.Body)

Warn logs an entry on level "WARN" with the received title along with all the values collected from the input valueMaps and the context.

type ContextParser

type ContextParser func(ctx context.Context) log.Body

Jump to

Keyboard shortcuts

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