log

package
v0.0.0-...-86cb477 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package log supports structured and unstructured logging with levels.

Index

Constants

View Source
const (
	SeverityDefault = Severity(iota)
	SeverityDebug
	SeverityInfo
	SeverityWarning
	SeverityError
	SeverityCritical
)

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, arg any)

Debug logs arg, which can be a string or a struct, at the Debug level.

func Debugf

func Debugf(ctx context.Context, format string, args ...any)

Debugf logs a formatted string at the Debug level.

func Error

func Error(ctx context.Context, arg any)

Error logs arg, which can be a string or a struct, at the Error level.

func Errorf

func Errorf(ctx context.Context, format string, args ...any)

Errorf logs a formatted string at the Error level.

func Fatal

func Fatal(ctx context.Context, arg any)

Fatal logs arg, which can be a string or a struct, at the Critical level followed by exiting the program.

func Fatalf

func Fatalf(ctx context.Context, format string, args ...any)

Fatalf logs formatted string at the Critical level followed by exiting the program.

func Info

func Info(ctx context.Context, arg any)

Info logs arg, which can be a string or a struct, at the Info level.

func Infof

func Infof(ctx context.Context, format string, args ...any)

Infof logs a formatted string at the Info level.

func SetLevel

func SetLevel(v string)

Set the log level

func Use

func Use(l Logger)

func Warning

func Warning(ctx context.Context, arg any)

Warning logs arg, which can be a string or a struct, at the Warning level.

func Warningf

func Warningf(ctx context.Context, format string, args ...any)

Warningf logs a formatted string at the Warning level.

Types

type Logger

type Logger interface {
	Log(ctx context.Context, s Severity, payload any)
	Flush()
}

type Severity

type Severity int

func (Severity) String

func (s Severity) String() string

Directories

Path Synopsis
Package log supports structured and unstructured logging with levels to GCP stackdriver.
Package log supports structured and unstructured logging with levels to GCP stackdriver.

Jump to

Keyboard shortcuts

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