Documentation ¶
Index ¶
- Constants
- func Debug(msg string, a ...interface{})
- func Error(msg string, a ...interface{})
- func ErrorFilePath() string
- func Fatal(msg string, a ...interface{})
- func Info(msg string, a ...interface{})
- func Level() loggers.LogLevel
- func LogFilePath() string
- func LogMemStats(location string)
- func MemStatFilePath() string
- func PrepareLogging(fs afero.Fs, verbose bool, loggerSpy io.Writer, fileLogging bool)
- func Warn(msg string, a ...interface{})
- func WithCtxFields(ctx context.Context) loggers.Logger
- func WithFields(fields ...field.Field) loggers.Logger
- type CtxGraphComponentId
- type CtxKeyAccount
- type CtxKeyCoord
- type CtxKeyEnv
- type CtxValEnv
- type CtxValGraphComponentId
Constants ¶
const ( LogDirectory = ".logs" LogFileTimestampPrefixFormat = "20060102-150405" )
Variables ¶
This section is empty.
Functions ¶
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 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 WithCtxFields ¶
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 ¶
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 CtxValGraphComponentId ¶ added in v2.6.0
type CtxValGraphComponentId int
CtxValGraphComponentId context value used for correlating logs that belong to deployment of a sub graph