logger

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLogger

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

FileLogger implements Logger using a file

func NewFileLogger

func NewFileLogger(filepath string, prefix string) (*FileLogger, error)

NewFileLogger creates a new FileLogger that writes to the specified file path If filepath is `app.log`, it will be named `app.{pid}.log`.

func (*FileLogger) Close

func (l *FileLogger) Close() error

Close closes the underlying file

func (*FileLogger) Logf

func (l *FileLogger) Logf(format string, args ...interface{})

Logf logs a formatted message

type Logger

type Logger interface {
	// Logf logs a formatted message
	Logf(format string, args ...interface{})
}

Logger defines the interface for MCP logging

type NoopLogger

type NoopLogger struct{}

NoopLogger implements Logger with no-op operations

func NewNoopLogger

func NewNoopLogger() *NoopLogger

NewNoopLogger creates a new NoopLogger

func (*NoopLogger) Logf

func (l *NoopLogger) Logf(format string, args ...interface{})

Logf logs a formatted message

type StderrLogger

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

StderrLogger implements Logger using stderr

func NewStderrLogger

func NewStderrLogger(prefix string) *StderrLogger

NewStderrLogger creates a new StderrLogger

func (*StderrLogger) Logf

func (l *StderrLogger) Logf(format string, args ...interface{})

Logf logs a formatted message

Jump to

Keyboard shortcuts

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