clog

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package clog provides an interface for sending log messages from yambsd to clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(ctx context.Context, args ...any) error

Log sends the supplied text, interpreted using fmt.Sprint.

func Logf

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

Logf sends the supplied text, intepreted using fmt.Sprintf.

func LoggerContext

func LoggerContext(ctx context.Context, lg Logger) context.Context

LoggerContext attaches a Logger to a new context derived from ctx. The returned context can later be passed to Log or Logf.

Types

type Logger

type Logger interface {
	// Log writes the supplied message.
	Log(string) error
}

Logger sends informational log messages to a client. This interface exists to prevent circular dependencies: this package can't depend on render, since render depends on seed and sources/text and those packages depend on this package to perform logging.

Jump to

Keyboard shortcuts

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