Help us shape the future of Go! Take the 2026 Go Developer Survey

hlog

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package hlog 提供基于 Hertz hlog 的 logx.Logger 实现。

此实现将结构化 kv 参数拼接为字符串(降级模式), 适合需要与 Hertz hlog 输出格式保持一致的场景。

用法:

import (
    "github.com/oekit/logx"
    logxhlog "github.com/oekit/logx/hlog"
)

logx.SetDefault(logxhlog.NewHlogLogger("my-service"))

注意: 将 hlog 后端的 Logger 传入 hertz.NewLogger 或 kitexlog.NewLogger 会导致无限递归。 这些场景应使用 logx.NewSlogLogger 或 logx.NewStdLogger。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHlogLogger

func NewHlogLogger(service string) logx.Logger

NewHlogLogger 创建带 service name 的 hlog Logger。

Types

This section is empty.

Jump to

Keyboard shortcuts

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