logger

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPRequest

type HTTPRequest struct {
	Body                string `json:"body"`
	BodySha256          string `json:"bodySha256"`
	Headers             string `json:"headers"`
	HeadersSorted       string `json:"headersSorted"`
	HeadersSortedSha256 string `json:"headersSortedSha256"`
	Method              string `json:"method"`
	ProtocolVersion     string `json:"protocolVersion"`
	Request             string `json:"request"`
	UserAgent           string `json:"userAgent"`
}

HTTPRequest contains information about the HTTP request.

type LLM

type LLM struct {
	Model       string  `json:"model"`
	Provider    string  `json:"provider"`
	Temperature float64 `json:"temperature"`
}

LLM contains information about the large language model.

type Logger

type Logger struct {
	EnrichCache *enrich.Enricher
	EventLogger *logrus.Logger
	LLMConfig   llm.Config
	Logger      *logrus.Logger
}

Logger contains the components for logging.

func New

func New(eventLogFile string, modelConfig llm.Config, eCache *enrich.Enricher, l *logrus.Logger) (*Logger, error)

New creates a new Logger instance with the specified configuration.

func (*Logger) LogError

func (l *Logger) LogError(r *http.Request, resp, port string, err error)

LogError logs a failedResponse event.

func (*Logger) LogEvent

func (l *Logger) LogEvent(r *http.Request, resp llm.JSONResponse, port string)

LogEvent logs a successfulResponse event.

Jump to

Keyboard shortcuts

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