bundles

package
v0.0.0-...-884d78e Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LogFormatPlainText means to write logs as a plain text.
	LogFormatPlainText = LogFormat(iota)

	// LogFormatPlainTextCompact means to write logs as a compact plain text.
	//
	// Falls back to LogFormatPlainText if the compact format is not supported.
	LogFormatPlainTextCompact

	// LogFormatJSON means to write logs as JSON objects.
	LogFormatJSON
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LoggerReportCaller bool
	TracerReportCaller bool
	TimestampFormat    string
	VerboseCaller      bool
	Tracer             xcontext.Tracer
	Format             LogFormat
}

Config is a configuration state resulted from Option-s.

func GetConfig

func GetConfig(opts ...Option) Config

GetConfig processes passed Option-s and returns the resulting state as Config.

type LogFormat

type LogFormat int

LogFormat is a selector of an output format.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is a modifier of what context to construct.

type OptionLogFormat

type OptionLogFormat LogFormat

OptionLogFormat defines the format for logs.

type OptionLoggerReportCaller

type OptionLoggerReportCaller bool

OptionLoggerReportCaller defines if it is required to determine source-code file name and line and report it to logs. It negatively affects performance of logging.

type OptionTimestampFormat

type OptionTimestampFormat string

OptionTimestampFormat defines the format of timestamps while logging.

type OptionTracer

type OptionTracer struct {
	xcontext.Tracer
}

OptionTracer defines if a tracer should be added to the context.

type OptionTracerReportCaller

type OptionTracerReportCaller bool

OptionTracerReportCaller the same as OptionLoggerReportCaller, but for a tracer.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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