Documentation ¶
Index ¶
- Variables
- func Compress(files []*os.File, dest string) error
- func CompressZip(src string, dest string) (err error)
- func DeCompress(zipFile, dest string) (err error)
- func DeCompressFile(file *zip.File, dest string) error
- func Debug(txt ...any)
- func Debugf(txt string, args ...any)
- func Error(txt ...any)
- func Errorf(txt string, args ...any)
- func Fatal(txt ...any)
- func Fatalf(txt string, args ...any)
- func Info(txt ...any)
- func Infof(txt string, args ...any)
- func PathExists(path string) (bool, error)
- func Report(txt ...any)
- func Reportf(txt string, args ...any)
- func SetLogger(l *Logger)
- func Warn(txt ...any)
- func Warnf(txt string, args ...any)
- type ChangChanType
- type LogItem
- type LogLevel
- type Logger
- func (l *Logger) Debug(txt ...any)
- func (l *Logger) Debugf(tmp string, args ...any)
- func (l *Logger) Error(txt ...any)
- func (l *Logger) Errorf(tmp string, args ...any)
- func (l *Logger) Fatal(txt ...any)
- func (l *Logger) Fatalf(tmp string, args ...any)
- func (l *Logger) GetCallerPath(file string) string
- func (l *Logger) Info(txt ...any)
- func (l *Logger) Infof(tmp string, args ...any)
- func (l *Logger) NewLogItem(level LogLevel, txt ...any) *LogItem
- func (l *Logger) Report(txt ...any)
- func (l *Logger) Reportf(tmp string, args ...any)
- func (l *Logger) Warn(txt ...any)
- func (l *Logger) Warnf(tmp string, args ...any)
- func (l *Logger) WithSuffix(suffix string) *Logger
- type Option
- func WithLogDir(dir string) Option
- func WithLogDump(dump bool) Option
- func WithLogLevel(level string) Option
- func WithLogName(name string) Option
- func WithLogRuntime(record bool) Option
- func WithOutType(typ string) Option
- func WithReporter(reporter Reporter) Option
- func WithStdColor(show bool) Option
- func WithTimeFormat(format string) Option
- type OutType
- type Reporter
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LevelDescMap = map[LogLevel]string{ REPORT: "REPORT", FATAL: "FATAL", ERROR: "ERROR", WARN: "WARN", INFO: "INFO", DEBUG: "DEBUG", } DescLevelMap = map[string]LogLevel{ "report": REPORT, "fatal": FATAL, "error": ERROR, "warn": WARN, "info": INFO, "debug": DEBUG, } DescOutTypeMap = map[string]OutType{ "out_std": OutStd, "out_file": OutFile, "out_all": OutAll, } LevelColorMap = map[LogLevel]*color.Color{ REPORT: color.New(color.FgHiWhite), FATAL: color.New(color.FgHiMagenta), ERROR: color.New(color.FgHiRed), WARN: color.New(color.FgHiYellow), INFO: color.New(color.FgHiBlue), DEBUG: color.New(color.FgHiCyan), } )
Functions ¶
func CompressZip ¶
func PathExists ¶
Types ¶
type ChangChanType ¶ added in v2.4.3
type ChangChanType int
const ( ChangChanZip ChangChanType = iota //改变zip chan ChangChanDump // 改变dump chan )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func WithSuffix ¶ added in v2.5.7
func (*Logger) GetCallerPath ¶
func (*Logger) WithSuffix ¶ added in v2.5.7
type Option ¶
type Option func(l *Logger)
func WithLogDir ¶
func WithLogDump ¶
func WithLogLevel ¶
func WithLogName ¶
func WithLogRuntime ¶
func WithReporter ¶ added in v2.3.3
func WithStdColor ¶
func WithTimeFormat ¶
Click to show internal directories.
Click to hide internal directories.