logger

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 0 Imported by: 0

README

Logger

logger 包定义了基础的日志级别类型。

内容

LogLevel

定义了日志级别字符串类型:

  • Info:信息(info
  • Error:错误(error
  • Success:成功(success
使用示例
import "github.com/fireflycore/go-micro/logger"

func Log(level logger.LogLevel, msg string) {
	_ = level
	_ = msg
}

Documentation

Overview

Package logger 定义 go-micro 的基础日志级别类型。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLogger added in v0.8.3

type AccessLogger struct {
	Method   int32  `json:"method"`
	Path     string `json:"path"`
	Request  string `json:"request"`
	Response string `json:"response"`
	Duration uint64 `json:"duration"`
	Status   uint32 `json:"status"`

	ClientIp        string `json:"client_ip"`
	SourceIp        string `json:"source_ip"`
	SourceIpAddress string `json:"source_ip_address"`

	ClientType    uint32 `json:"client_type"`
	ClientName    string `json:"client_name"`
	ClientVersion string `json:"client_version"`

	SystemType    uint32 `json:"system_type"`
	SystemName    string `json:"system_name"`
	SystemVersion string `json:"system_version"`
	AppVersion    string `json:"app_version"`

	InvokeServiceAppId    string `json:"invoke_service_app_id"`
	InvokeServiceEndpoint string `json:"invoke_service_endpoint"`
	TargetServiceAppId    string `json:"target_service_app_id"`
	TargetServiceEndpoint string `json:"target_service_endpoint"`

	TraceId  string `json:"trace_id"`
	UserId   string `json:"user_id"`
	AppId    string `json:"app_id"`
	TenantId string `json:"tenant_id"`
}

AccessLogger 表示访问日志。

type LogLevel

type LogLevel string

LogLevel 表示日志级别。

const (
	// Info 表示信息级别日志。
	Info LogLevel = "info"
	// Error 表示错误级别日志。
	Error LogLevel = "error"
	// Success 表示成功级别日志。
	Success LogLevel = "success"
)

Jump to

Keyboard shortcuts

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