logger

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package logger handles structured logging for agents

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultLogDir

func GetDefaultLogDir() string

GetDefaultLogDir returns the default log directory (~/.maxam/logs)

func ProjectNameFromPath

func ProjectNameFromPath(path string) string

ProjectNameFromPath converts a directory path to a project name. Example: /home/user/my-project -> home_user_my-project

Types

type Entry

type Entry struct {
	Timestamp time.Time
	Agent     string
	Input     string
	Thinking  string
	Output    string
	Duration  time.Duration
}

Entry represents a log entry

func (*Entry) Format

func (e *Entry) Format() string

Format returns the entry in markdown format

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger handles logging for a specific agent

func New

func New(baseDir, agent string) (*Logger, error)

New creates a new logger for an agent

func (*Logger) Close

func (l *Logger) Close() error

Close closes the log file

func (*Logger) Log

func (l *Logger) Log(entry *Entry) error

Log writes an entry to the log

func (*Logger) LogSimple

func (l *Logger) LogSimple(input, output string, duration time.Duration) error

LogSimple writes a simple log entry

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages loggers for all agents

func NewManager

func NewManager(baseDir, projectDir string) *Manager

NewManager creates a new logger manager with project-specific subdirectory. baseDir: logs directory (e.g., ~/.maxam/logs) projectDir: working directory for the project (used to generate project name)

func (*Manager) Close

func (m *Manager) Close()

Close closes all loggers

func (*Manager) Get

func (m *Manager) Get(agent string) (*Logger, error)

Get returns a logger for an agent, creating if needed

Jump to

Keyboard shortcuts

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