logging

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package logging provides structured logging for deepseekcode.

When debug is off, logs are discarded (callers can still use slog.X without conditionals). When on, logs go to .deepseek/log/<date>.jsonl under the supplied dir.

Mode controls whether stderr is also a sink. ModeCLI writes to both (stderr + file); ModeTUI is file-only because Bubble Tea's AltScreen would corrupt the display if anything else wrote to the terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedactAPIKey

func RedactAPIKey(key string) string

RedactAPIKey returns a shortened representation of a key-like string.

func RedactPath

func RedactPath(path string) string

RedactPath returns "[redacted:<ext>]" if the basename looks like a secrets file; otherwise returns the path unchanged.

func Setup

func Setup(debug bool, mode Mode, dir string) *slog.Logger

Setup configures the global slog logger. dir is the directory under which .deepseek/log/ is created.

Types

type Mode

type Mode int

Mode controls whether logs are mirrored to stderr alongside the file.

const (
	ModeCLI Mode = iota // stderr + file
	ModeTUI             // file only (avoids corrupting AltScreen)
)

Jump to

Keyboard shortcuts

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