fn

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

fn 使用函数方式记录日志,函数由调用者提供

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	ctx context.Context,
	logFunc func(logger.Level, string, ...any),
	canLogFunc func(logger.Level) bool,
) logger.Logger

Types

type FnLogger

type FnLogger struct {
	LogFunc    func(level logger.Level, format string, params ...any)
	CanLogFunc func(level logger.Level) bool
	// contains filtered or unexported fields
}

func (*FnLogger) CanLog

func (l *FnLogger) CanLog(level logger.Level) bool

func (*FnLogger) Log

func (l *FnLogger) Log(level logger.Level, format string, params ...any)

func (*FnLogger) LogAlter

func (l *FnLogger) LogAlter(format string, params ...any)

func (*FnLogger) LogCrit

func (l *FnLogger) LogCrit(format string, params ...any)

func (*FnLogger) LogDebug

func (l *FnLogger) LogDebug(format string, params ...any)

func (*FnLogger) LogEmerg

func (l *FnLogger) LogEmerg(format string, params ...any)

func (*FnLogger) LogError

func (l *FnLogger) LogError(format string, params ...any)

func (*FnLogger) LogInfo

func (l *FnLogger) LogInfo(format string, params ...any)

func (*FnLogger) LogNotice

func (l *FnLogger) LogNotice(format string, params ...any)

func (*FnLogger) LogWarning

func (l *FnLogger) LogWarning(format string, params ...any)

Jump to

Keyboard shortcuts

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