logger

package
v0.22.6 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package logger 请求日志,输出`一次请求`的一些信息,即使发生异常(`panic`),也能输出

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config ...*Config) zeroapi.Handler

New 记录每一条请求的信息

Types

type Config

type Config struct {
	// IP 是否打印 IP,默认 true
	IP bool

	// Code 是否打印 HTTP Code,默认 true
	Code bool

	// Cost 是否打印花费的时间,默认 true
	Cost bool

	// Extend 日志扩展,拼接该函数的返回结果
	Extend func(ctx zeroapi.Context) string
}

Config 配置

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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