logger

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string, v ...interface{})

Debug logs a debug message

func Error

func Error(format string, v ...interface{})

Error logs an error message

func ErrorWithStack

func ErrorWithStack(err error)

ErrorWithStack logs an error with a stack trace

func Info

func Info(format string, v ...interface{})

Info logs an info message

func Initialize

func Initialize(level string)

Initialize sets up the logger with the specified level

func InitializeWithWriter added in v1.3.0

func InitializeWithWriter(level string, writer *os.File)

InitializeWithWriter sets up the logger with the specified level and output writer

func RequestLog

func RequestLog(method, url, sessionID, body string)

RequestLog logs details of an HTTP request

func RequestResponseLog

func RequestResponseLog(method, sessionID string, requestData, responseData string)

RequestResponseLog logs a combined request and response log entry

func ResponseLog

func ResponseLog(statusCode int, sessionID, body string)

ResponseLog logs details of an HTTP response

func SSEEventLog

func SSEEventLog(eventType, sessionID, data string)

SSEEventLog logs details of an SSE event

func Warn

func Warn(format string, v ...interface{})

Warn logs a warning message

Types

type Level

type Level int

Level represents the severity of a log message

const (
	// LevelDebug for detailed troubleshooting
	LevelDebug Level = iota
	// LevelInfo for general operational entries
	LevelInfo
	// LevelWarn for non-critical issues
	LevelWarn
	// LevelError for errors that should be addressed
	LevelError
)

Jump to

Keyboard shortcuts

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