pulse

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Go

func Go(logger Logger, f func())

Go runs the given function in a separate goroutine and recovers from any panic, logging the panic message and stack trace.

Usage:

Go(ctx, func() {
    // Your code here
})

Types

type Logger

type Logger interface {
	// EnableDebug turns on debug logging.
	EnableDebug()
	// WithPrefix returns a logger that prefixes all log entries with the
	// given key-value pairs.
	WithPrefix(kvs ...any) Logger
	// Debug logs a debug message.
	Debug(msg string, kvs ...any)
	// Info logs an info message.
	Info(msg string, kvs ...any)
	// Error logs an error message.
	Error(err error, kvs ...any)
}

Interface used by pulse to write log entries.

func ClueLogger

func ClueLogger(logCtx context.Context) Logger

ClueLogger adapts a clue logger to a pulse logger.

func NoopLogger

func NoopLogger() Logger

NoopLogger returns a no-op logger.

func StdLogger

func StdLogger(logger *stdlog.Logger) Logger

StdLogger adapts a Go standard library logger to a pulse logger.

Jump to

Keyboard shortcuts

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