logger

package
v0.0.0-...-f8747f6 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CtxWithLogger

func CtxWithLogger(ctx context.Context, log zerolog.Logger) context.Context

CtxWithLogger attaches a zerolog.Logger instance to the context.

func Debug

func Debug(v ...interface{})

func Debugf

func Debugf(format string, v ...interface{})

func Error

func Error(v ...interface{})

func Errorf

func Errorf(format string, v ...interface{})

func Fatal

func Fatal(v ...interface{})

func Fatalf

func Fatalf(format string, v ...interface{})

func FromContext

func FromContext(ctx context.Context) zerolog.Logger

FromContext retrieves the logger instance from context, or returns the global logger.

func Info

func Info(v ...interface{})

func Infof

func Infof(format string, v ...interface{})

func Init

func Init()

func Log

func Log(ctx context.Context) log.Logger

Log returns a Temporal-compatible logger that writes to workflow file if available. Usage: logger.Log(ctx).Info("message", "key", value)

func StripANSI

func StripANSI(s string) string

func Warn

func Warn(v ...interface{})

func Warnf

func Warnf(format string, v ...interface{})

Types

type WorkflowLogFile

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

WorkflowLogFile holds the file handle for a workflow's log file.

func InitWorkflowLogger

func InitWorkflowLogger(ctx context.Context, workflowLogsDir string) (context.Context, *WorkflowLogFile, error)

InitWorkflowLogger creates a zerolog.Logger instance that writes to both stdout and <workflowDir>/worker.log. Returns the logger instance and a file handle that must be closed when the workflow finishes. Note: workflowDir must already exist before calling this function.

func (*WorkflowLogFile) Close

func (wf *WorkflowLogFile) Close() error

Close must be called when the workflow finishes.

Jump to

Keyboard shortcuts

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