logger

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Default is the default logger used by the application.
	Default = NewLogger(NewLoggerArgs{
		Format: "text",
	})
)

Functions

func OpenLogFile added in v1.0.6

func OpenLogFile(config LogFileConfig) (*os.File, error)

OpenLogFile opens a log file for the workflow.

Types

type LogFileConfig added in v1.0.6

type LogFileConfig struct {
	Prefix    string
	LogDir    string
	DAGLogDir string
	DAGName   string
	RequestID string
}

LogFileConfig holds the configuration for opening a log file

type Logger

type Logger interface {
	Debug(msg string, tags ...any)
	Info(msg string, tags ...any)
	Warn(msg string, tags ...any)
	Error(msg string, tags ...any)
	Fatal(msg string, tags ...any)

	Debugf(format string, v ...any)
	Infof(format string, v ...any)
	Warnf(format string, v ...any)
	Errorf(format string, v ...any)
	Fatalf(format string, v ...any)

	With(attrs ...any) Logger
	WithGroup(name string) Logger

	// Write writes a free-form message to the logger.
	// It writes to the standard output and to the log file if present.
	// If the log file is not present, it writes only to the standard output.
	Write(string)
}

func NewLogger added in v1.0.6

func NewLogger(args NewLoggerArgs) Logger

type NewLoggerArgs added in v1.0.6

type NewLoggerArgs struct {
	Debug   bool
	Format  string
	LogFile *os.File
	Quiet   bool
}

Jump to

Keyboard shortcuts

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