logger

package
v0.0.0-...-69fac63 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

logger/logger.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBufferSnapshot

func GetBufferSnapshot() []string

GetBufferSnapshot returns the latest log lines kept in memory.

func LogPrintf

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

func LogRequestAndResponse

func LogRequestAndResponse(r *http.Request, targetURL string, proxyResp *http.Response)

添加日志函数

func SetupLogger

func SetupLogger(cfg LogConfig)

func Subscribe

func Subscribe() (<-chan string, func())

Subscribe returns a channel for live log lines and a cancel function.

Types

type LogConfig

type LogConfig struct {
	Enabled    bool
	File       string
	MaxSizeMB  int
	MaxBackups int
	MaxAgeDays int
	Compress   bool
}

Jump to

Keyboard shortcuts

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