log

package
v0.0.0-...-8845b87 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 4 Imported by: 0

README

log

use uber zap

other log

  • github.com/charmbracelet/log

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields ...Field)

func DefaultLogger

func DefaultLogger() *zap.Logger

sDefaultLogger creates a default logger for uninitialized usage.

func Error

func Error(msg string, fields ...Field)

func Errorf

func Errorf(template string, args ...interface{})

func Fatal

func Fatal(msg string, fields ...Field)

func Info

func Info(msg string, fields ...Field)

func Infof

func Infof(template string, args ...interface{})

func InitLogger

func InitLogger(cfg Config) error

InitLogger initializes a zap logger from user config.

func Warn

func Warn(msg string, fields ...Field)

Types

type Config

type Config struct {
	Level string `yaml:"level"`
	Mode  string `yaml:"mode"`
}

Log represents a logging configuration.

type Field

type Field = zap.Field

func Any

func Any(key string, value interface{}) Field

func Int32

func Int32(key string, val int32) Field

func Int64

func Int64(key string, val int64) Field

func Reflect

func Reflect(key string, val interface{}) Field

func Stack

func Stack() Field

func String

func String(key string, val string) Field

func Uint16

func Uint16(key string, val uint16) Field

func Uint32

func Uint32(key string, val uint32) Field

func Uint64

func Uint64(key string, val uint64) Field

Jump to

Keyboard shortcuts

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