logger

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Timestamp      time.Time         `json:"timestamp"`
	Method         string            `json:"method"`
	URL            string            `json:"url"`
	Headers        map[string]string `json:"headers,omitempty"`
	Body           string            `json:"body,omitempty"`
	ResponseStatus int               `json:"response_status"`
	ResponseBody   string            `json:"response_body,omitempty"`
	TimeMs         int64             `json:"time_ms"`
	Payload        string            `json:"payload"`
	Module         string            `json:"module"`
	Point          string            `json:"point"`
}

LogEntry represents a single request/response log line

type ScanLogger

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

ScanLogger writes JSON lines to a file

func NewScanLogger

func NewScanLogger(path string) (*ScanLogger, error)

NewScanLogger opens a file for append and returns a logger

func (*ScanLogger) Close

func (l *ScanLogger) Close()

Close closes the file

func (*ScanLogger) Log

func (l *ScanLogger) Log(entry LogEntry)

Log writes one JSON line

Jump to

Keyboard shortcuts

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