m3util

package
Version: v0.0.0-...-7ccf7c6 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = NewLogger("m3util", INFO)

Functions

func AbsPath

func AbsPath(dir string) string

func CloseFile

func CloseFile(file *os.File)

func CreateFile

func CreateFile(dir, fileName string) *os.File

func DirExists

func DirExists(dir string, subPath string) (bool, string)

func ExitOnError

func ExitOnError(err error)

func GetBuildDir

func GetBuildDir() string

func GetConfDir

func GetConfDir() string

func GetGenDocDir

func GetGenDocDir() string

func GetGitRootDir

func GetGitRootDir() string

func GetLevelName

func GetLevelName(level LogLevel) string

func Write

func Write(writer *csv.Writer, records []string)

func WriteAll

func WriteAll(writer *csv.Writer, records [][]string)

func WriteNextString

func WriteNextString(file *os.File, text string)

Types

type BaseLogger

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

func (*BaseLogger) Debug

func (l *BaseLogger) Debug(a ...interface{})

func (*BaseLogger) Debugf

func (l *BaseLogger) Debugf(format string, v ...interface{})

func (*BaseLogger) DoAssert

func (l *BaseLogger) DoAssert() bool

func (*BaseLogger) Error

func (l *BaseLogger) Error(a ...interface{})

func (*BaseLogger) Errorf

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

func (*BaseLogger) Fatal

func (l *BaseLogger) Fatal(a ...interface{})

Fatal panic out

func (*BaseLogger) Fatalf

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

func (*BaseLogger) GetLevelName

func (l *BaseLogger) GetLevelName() string

func (*BaseLogger) IgnoreNextError

func (l *BaseLogger) IgnoreNextError()

func (*BaseLogger) Info

func (l *BaseLogger) Info(a ...interface{})

func (*BaseLogger) Infof

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

func (*BaseLogger) IsDebug

func (l *BaseLogger) IsDebug() bool

func (*BaseLogger) IsError

func (l *BaseLogger) IsError() bool

func (*BaseLogger) IsInfo

func (l *BaseLogger) IsInfo() bool

func (*BaseLogger) IsTrace

func (l *BaseLogger) IsTrace() bool

func (*BaseLogger) IsWarn

func (l *BaseLogger) IsWarn() bool

func (*BaseLogger) SetAssert

func (l *BaseLogger) SetAssert(enable bool)

func (*BaseLogger) SetDebug

func (l *BaseLogger) SetDebug()

func (*BaseLogger) SetError

func (l *BaseLogger) SetError()

func (*BaseLogger) SetInfo

func (l *BaseLogger) SetInfo()

func (*BaseLogger) SetTrace

func (l *BaseLogger) SetTrace()

func (*BaseLogger) SetWarn

func (l *BaseLogger) SetWarn()

func (*BaseLogger) Trace

func (l *BaseLogger) Trace(a ...interface{})

func (*BaseLogger) Tracef

func (l *BaseLogger) Tracef(format string, v ...interface{})

func (*BaseLogger) Warn

func (l *BaseLogger) Warn(a ...interface{})

func (*BaseLogger) Warnf

func (l *BaseLogger) Warnf(format string, v ...interface{})

type LogLevel

type LogLevel int
const (
	TRACE LogLevel = iota
	DEBUG
	INFO
	WARN
	ERROR
	FATAL
)

type Logger

type Logger interface {
	GetLevelName() string

	DoAssert() bool
	SetAssert(enable bool)

	SetTrace()
	IsTrace() bool
	Trace(a ...interface{})
	Tracef(format string, v ...interface{})

	SetDebug()
	IsDebug() bool
	Debug(a ...interface{})
	Debugf(format string, v ...interface{})

	SetInfo()
	IsInfo() bool
	Info(a ...interface{})
	Infof(format string, v ...interface{})

	SetWarn()
	IsWarn() bool
	Warn(a ...interface{})
	Warnf(format string, v ...interface{})

	SetError()
	IsError() bool
	Error(a ...interface{})
	Errorf(format string, v ...interface{})

	Fatal(a ...interface{})
	Fatalf(format string, v ...interface{})

	IgnoreNextError()
}

func NewDataLogger

func NewDataLogger(prefix string, level LogLevel) Logger

func NewLogger

func NewLogger(prefix string, level LogLevel) Logger

func NewStatLogger

func NewStatLogger(prefix string, level LogLevel) Logger

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL