logger

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package logger provides an interface for customizable client logging.

Index

Constants

This section is empty.

Variables

View Source
var Error = &ErrorLogger{def: &Default{}}
View Source
var Nil = &NilLogger{}

Functions

This section is empty.

Types

type Default

type Default struct{}

func (*Default) Log

func (l *Default) Log(ctx context.Context, e *Event)

type ErrorLogger

type ErrorLogger struct {
	// contains filtered or unexported fields
}

func (*ErrorLogger) Log

func (l *ErrorLogger) Log(ctx context.Context, e *Event)

type Event

type Event struct {
	Level   string      `json:"level"`
	Message string      `json:"msg"`
	JobID   string      `json:"job_id,omitempty"`
	Data    interface{} `json:"data,omitempty"`
	Error   error       `json:"error,omitempty"`
}

type Logger

type Logger interface {
	Log(ctx context.Context, e *Event)
}

type NilLogger

type NilLogger struct{}

func (*NilLogger) Log

func (l *NilLogger) Log(ctx context.Context, e *Event)

Jump to

Keyboard shortcuts

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