logging

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 6 Imported by: 35

Documentation

Overview

Package logging provides loggers for Kopia.

Index

Constants

This section is empty.

Variables

View Source
var NullLogger = zap.NewNop().Sugar()

NullLogger represents a singleton logger that discards all output.

Functions

func Module added in v0.9.1

func Module(module string) func(ctx context.Context) Logger

Module returns an function that returns a logger for a given module when provided with a context.

func WithAdditionalLogger added in v0.14.0

func WithAdditionalLogger(ctx context.Context, fact LoggerFactory) context.Context

WithAdditionalLogger returns a context where all logging is emitted the original output plus the provided logger factory.

func WithLogger

func WithLogger(ctx context.Context, l LoggerFactory) context.Context

WithLogger returns a derived context with associated logger.

Types

type Logger

type Logger = *zap.SugaredLogger

Logger is used by Kopia to emit various logs.

func Broadcast added in v0.9.0

func Broadcast(logger ...Logger) Logger

Broadcast is a logger that broadcasts each log message to multiple loggers.

type LoggerFactory added in v0.9.1

type LoggerFactory func(module string) Logger

LoggerFactory retrieves a named logger for a given module.

func ToWriter added in v0.11.0

func ToWriter(w io.Writer) LoggerFactory

ToWriter returns LoggerFactory that uses given writer for log output (unadorned).

Jump to

Keyboard shortcuts

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