log

package
v2.17.4 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogDirectory                 = ".logs"
	LogFileTimestampPrefixFormat = "20060102-150405"
)

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, a ...interface{})

func Error

func Error(msg string, a ...interface{})

func ErrorFilePath added in v2.8.1

func ErrorFilePath() string

ErrorFilePath returns the path of an error logfile for the current execution time - depending on when this function is called such a file may not yet exist

func Fatal

func Fatal(msg string, a ...interface{})

func Info

func Info(msg string, a ...interface{})

func Level

func Level() loggers.LogLevel

func LogFilePath added in v2.8.1

func LogFilePath() string

LogFilePath returns the path of a logfile for the current execution time - depending on when this function is called such a file may not yet exist

func LogMemStats added in v2.16.0

func LogMemStats(location string)

LogMemStats creates a log line of memory stats which is useful for manually debugging/validating memory consumption. This is not used in general, but is highly useful when detailed memory information is needed - in which case it is nice to have a reusable method, rather than creating it again. Place this method where needed and supply location information - e.g. "before sort" and "after sort".

This method will create a CSV file as well as write into the log.

You can acquire further information - like mem stats sampled by minute or 10sec intervals - by creating a structured log and using the utility script tools/parse-memstats-from-json-log.sh to post-process the log file.

func MemStatFilePath added in v2.16.0

func MemStatFilePath() string

MemStatFilePath returns the full path of an memory statistics log file for the current execution time - if no stats are written (yet) no file may exist at this path.

func PrepareLogging

func PrepareLogging(fs afero.Fs, verbose bool, loggerSpy io.Writer, fileLogging bool)

func Warn

func Warn(msg string, a ...interface{})

func WithCtxFields

func WithCtxFields(ctx context.Context) loggers.Logger

WithCtxFields creates a logger instance with preset structured logging field.Field based on the Context Coordinate (via CtxKeyCoord) and environment (via CtxKeyEnv CtxValEnv) information is added to logs from the Context

func WithFields

func WithFields(fields ...field.Field) loggers.Logger

WithFields adds additional field.Field for structured logs It accepts vararg fields and should not be called more than once per log call

Types

type CtxGraphComponentId added in v2.6.0

type CtxGraphComponentId struct{}

CtxGraphComponentId context key used for correlating logs that belong to deployment of a sub graph

type CtxKeyAccount added in v2.10.0

type CtxKeyAccount struct{}

CtxKeyAccount context key used for contextual account information

type CtxKeyCoord

type CtxKeyCoord struct{}

CtxKeyCoord context key used for contextual coordinate information

type CtxKeyEnv

type CtxKeyEnv struct{}

CtxKeyEnv context key used for contextual environment information

type CtxValEnv

type CtxValEnv struct {
	Name  string
	Group string
}

CtxValEnv context value used for contextual environment information

type CtxValGraphComponentId added in v2.6.0

type CtxValGraphComponentId int

CtxValGraphComponentId context value used for correlating logs that belong to deployment of a sub graph

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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