logger

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() *slog.Logger

func Init

func Init(useStderr bool)

Init initializes the global logger If useStderr is true, logs will be written to stderr (for stdio mode) If useStderr is false, logs will be written to stdout (for HTTP mode)

func InitWithEnv added in v0.0.10

func InitWithEnv()

InitWithEnv initializes the logger using environment variables This is a convenience function that defaults to stdout unless KAGENT_USE_STDERR is set

func LogExecCommand

func LogExecCommand(ctx context.Context, logger *slog.Logger, command string, args []string, caller string)

func LogExecCommandResult

func LogExecCommandResult(ctx context.Context, logger *slog.Logger, command string, args []string, output string, err error, duration float64, caller string)

func RedactArgsForLog added in v0.0.15

func RedactArgsForLog(args []string) []string

RedactArgsForLog returns a copy of args with sensitive values redacted for logging. Any value immediately following "--token" is replaced with "<REDACTED>" so tokens are not logged.

func Sync

func Sync()

func WithContext

func WithContext(ctx context.Context) *slog.Logger

Types

This section is empty.

Jump to

Keyboard shortcuts

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