dwarflog

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Dot                  = "."
	Slash                = "/"
	FileSuffix           = ".log"
	RollingInAdvance     = time.Second * 5 // must greater than 0
	RollingCheckInterval = time.Second * 3 // must greater than 0
	CloseFileDelay       = time.Second * 2 // must greater than 0

	PaleFormat = LogFormat("pale")
	JsonFormat = LogFormat("json")

	PanicLevel = LogLevel("panic")
	FatalLevel = LogLevel("fatal")
	ErrorLevel = LogLevel("error")
	InfoLevel  = LogLevel("info")
)

Variables

This section is empty.

Functions

func Error

func Error(v ...interface{})

func Errorf

func Errorf(format string, v ...interface{})

func Errorrln

func Errorrln(v ...interface{})

func Fatal

func Fatal(v ...interface{})

func Fatalf

func Fatalf(format string, v ...interface{})

func Fatalln

func Fatalln(v ...interface{})

func Info

func Info(v ...interface{})

func Infof

func Infof(format string, v ...interface{})

func Infoln

func Infoln(v ...interface{})

func NewDwarfLog

func NewDwarfLog() *lg

func Panic

func Panic(v ...interface{})

func Panicf

func Panicf(format string, v ...interface{})

func Panicln

func Panicln(v ...interface{})

func Setup

func Setup(cfg *Config)

Types

type Config

type Config struct {
	Format     LogFormat
	Rolling    bool
	Path       string
	FilePrefix string
}

type LogFormat

type LogFormat string

type LogJsonFormat

type LogJsonFormat struct {
	Level  LogLevel `json:"level"`
	Date   string   `json:"date"`
	Caller string   `json:"caller"`
	Msg    string   `json:"msg"`
}

type LogLevel

type LogLevel string

type LogLevelDate

type LogLevelDate string

Jump to

Keyboard shortcuts

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