log

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

View Source
const DefaultFilename = "./app.log"
View Source
const HumanTime = "_human_time"

Variables

This section is empty.

Functions

func Debug

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

func Debugf

func Debugf(template string, args ...any)

func Error

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

func Errorf

func Errorf(template string, args ...any)

func Fatal

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

func Fatalf

func Fatalf(template string, args ...any)

func Info

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

func Infof

func Infof(template string, args ...any)

func Panic added in v0.2.0

func Panic(msg string, fields ...zap.Field)

func Panicf added in v0.2.0

func Panicf(template string, args ...any)

func Trace

func Trace(msg string, fields ...zap.Field)

func Warn

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

func Warnf

func Warnf(template string, args ...any)

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func Default

func Default() *Config

func (*Config) Init

func (c *Config) Init()

func (*Config) WithErrorLog added in v0.5.0

func (c *Config) WithErrorLog(optionErrorLogFilename string) *Config

func (*Config) WithFields added in v0.3.3

func (c *Config) WithFields(fields map[string]any) *Config

func (*Config) WithFilename

func (c *Config) WithFilename(filename string) *Config

func (*Config) WithHumanTime added in v0.3.4

func (c *Config) WithHumanTime(location *time.Location) *Config

func (*Config) WithLevel added in v0.3.0

func (c *Config) WithLevel(level Level) *Config

func (*Config) WithWarnLog added in v0.5.0

func (c *Config) WithWarnLog(optionWarnLogFilename string) *Config

type FieldsConfig added in v0.3.3

type FieldsConfig struct {
	// contains filtered or unexported fields
}

type FileConfig

type FileConfig struct {
	// contains filtered or unexported fields
}

type Level added in v0.3.1

type Level int8

A Level is a logging priority. Higher levels are more important.

const (
	// DebugLevel logs are typically voluminous, and are usually disabled in
	// production.
	DebugLevel Level = iota - 1
	// InfoLevel is the default logging priority.
	InfoLevel
	// WarnLevel logs are more important than Info, but don't need individual
	// human review.
	WarnLevel
	// ErrorLevel logs are high-priority. If an application is running smoothly,
	// it shouldn't generate any error-level logs.
	ErrorLevel
	// DPanicLevel logs are particularly important errors. In development the
	// logger panics after writing the message.
	DPanicLevel
	// PanicLevel logs a message, then panics.
	PanicLevel
	// FatalLevel logs a message, then calls os.Exit(1).
	FatalLevel

	// InvalidLevel is an invalid value for Level.
	//
	// Core implementations may panic if they see messages of this level.
	InvalidLevel = _maxLevel + 1
)

type LevelFilterFileConfig added in v0.5.0

type LevelFilterFileConfig struct {
	// contains filtered or unexported fields
}

type StdoutConfig

type StdoutConfig struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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