Documentation
¶
Overview ¶
Package log provides structured logging functionality for ghtkn. It uses slog with tint handler for colored output to stderr.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶ added in v0.2.0
func InitLogger(l *Logger)
InitLogger initializes any nil logging functions in the provided Logger with default implementations. This function allows partial customization of logging behavior by only overriding specific log functions while falling back to defaults for unset functions.
Types ¶
type Logger ¶
type Logger struct {
// Expire logs when an access token expiration date is processed.
Expire func(logger *slog.Logger, exDate time.Time)
// FailedToOpenBrowser logs when the browser cannot be opened for authentication.
FailedToOpenBrowser func(logger *slog.Logger, err error)
// FailedToGetAccessTokenFromKeyring logs when access token retrieval from keyring fails.
FailedToGetAccessTokenFromKeyring func(logger *slog.Logger, err error)
// AccessTokenIsNotFoundInKeyring logs when no access token is found in the keyring.
AccessTokenIsNotFoundInKeyring func(logger *slog.Logger)
// FailedToGetAppFromKeyring logs when app retrieval from keyring fails.
FailedToGetAppFromKeyring func(logger *slog.Logger, err error)
// AppIsNotFoundInKeyring logs when no app is found in the keyring.
AppIsNotFoundInKeyring func(logger *slog.Logger)
}
Logger provides structured logging functions for ghtkn operations. Each field is a function that logs specific events with appropriate log levels.
Click to show internal directories.
Click to hide internal directories.