fplog

package
v0.1.0-beta.202310161033 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithLogger

func ContextWithLogger(ctx context.Context) context.Context

func ExecutionLogger

func ExecutionLogger(ctx context.Context, executionID string) *zap.Logger

Types

type FlowpipeLogger

type FlowpipeLogger struct {

	// Level is the logging level to use for output
	Level zapcore.Level

	// Special handling for the "trace" level
	TraceLevel string

	// Format is the logging format to use for output: json or console
	Format string

	// Color is whether to use color in the console output
	Color bool

	// Zap is the Zap logger instance
	Zap   *zap.Logger
	Sugar *zap.SugaredLogger
}

func Logger

func Logger(ctx context.Context) *FlowpipeLogger

func NewLogger

func NewLogger(ctx context.Context, opts ...LoggerOption) (*FlowpipeLogger, error)

NewLogger creates a new Logger.

func (*FlowpipeLogger) Debug

func (c *FlowpipeLogger) Debug(msg string, keysAndValues ...interface{})

func (*FlowpipeLogger) Error

func (c *FlowpipeLogger) Error(msg string, keysAndValues ...interface{})

func (*FlowpipeLogger) Info

func (c *FlowpipeLogger) Info(msg string, keysAndValues ...interface{})

func (*FlowpipeLogger) Initialize

func (c *FlowpipeLogger) Initialize() error

func (*FlowpipeLogger) Sync

func (c *FlowpipeLogger) Sync() error

func (*FlowpipeLogger) Trace

func (c *FlowpipeLogger) Trace(msg string, keysAndValues ...interface{})

func (*FlowpipeLogger) Warn

func (c *FlowpipeLogger) Warn(msg string, keysAndValues ...interface{})

type LoggerOption

type LoggerOption func(*FlowpipeLogger) error

LoggerOption defines a type of function to configures the Logger.

func WithColor

func WithColor(enabled bool) LoggerOption

func WithFormatFromEnvironment

func WithFormatFromEnvironment() LoggerOption

func WithLevelFromEnvironment

func WithLevelFromEnvironment() LoggerOption

Jump to

Keyboard shortcuts

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