log

package
v0.0.0-...-a69402d Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 8 Imported by: 0

README

log

log 目前最低级别是 debug,可以通过 LOG_LEVEL 环境变量或者配置项指定。

log 会记录上下文信息息,所以需要传入一个 ctx 才能获取 log 实例。

示例

import "github.com/busyfree/leaf-go/util/log"

log.Get(ctx).Errorf("1 + 2 = %d", 1 + 2)

Documentation

Overview

Package log 基础日志组件

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PP

func PP(args ...interface{})

PP 类似 PHP 的 var_dump

func Reset

func Reset()

Reset 使用最新配置重置日志级别

Types

type Fields

type Fields = logrus.Fields

Fields fields

type Logger

type Logger = *logrus.Entry

Logger logger

func Get

func Get(ctx context.Context) Logger

Get 获取日志实例

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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