Documentation
¶
Index ¶
- Constants
- func Attribute(key AttributeKey, value any) (attribute slog.Attr)
- func CleanModelNameForFileSystem(modelName string) (modelNameCleaned string)
- func CloseOpenLogFiles()
- type AttributeKey
- type Flags
- type Logger
- func (l *Logger) Fatal(v ...any)
- func (l *Logger) Panic(message string)
- func (l *Logger) Panicf(format string, args ...any)
- func (l *Logger) Print(message string)
- func (l *Logger) PrintWith(message string, args ...any)
- func (l *Logger) Printf(format string, args ...any)
- func (l *Logger) SetFlags(flags Flags)
- func (l *Logger) With(key AttributeKey, value any) *Logger
- func (l *Logger) Writer() (writer io.Writer)
Constants ¶
View Source
const ( AttributeKeyArtifact AttributeKey = "Artifact" AttributeKeyLanguage = "Language" AttributeKeyModel = "Model" AttributeKeyRepository = "Repository" AttributeKeyResultPath = "ResultPath" AttributeKeyRun = "Run" AttributeKeyTask = "Task" )
View Source
const ( FlagMessageOnly = 0 FlagDate = 1 << iota FlagTime FlagStandard = FlagDate | FlagTime )
Variables ¶
This section is empty.
Functions ¶
func Attribute ¶ added in v0.6.0
func Attribute(key AttributeKey, value any) (attribute slog.Attr)
Attribute returns a logging attribute.
func CleanModelNameForFileSystem ¶ added in v0.6.0
CleanModelNameForFileSystem cleans a model name to be useable for directory and file names on the file system.
func CloseOpenLogFiles ¶ added in v0.6.0
func CloseOpenLogFiles()
CloseOpenLogFiles closes the files that were opened by some logger.
Types ¶
type AttributeKey ¶ added in v0.6.0
type AttributeKey string
AttributeKey defines a key for attributes handed to the structural logger.
type Logger ¶
Logger holds a logger to log to.
func Buffer ¶
func Buffer() (buffer *bytesutil.SynchronizedBuffer, logger *Logger)
Buffer returns a logger that writes to a buffer.
func (*Logger) SetFlags ¶ added in v0.6.0
SetFlags sets the flags defining how log messages should be printed.
Click to show internal directories.
Click to hide internal directories.