Beispiel #1
0
func testLogger() {
	var w io.WriteCloser

	w = os.Stdout

	Println("w == os.Stdout", w == os.Stdout)

	Println("ModeDir = ", os.ModeDir)
	Println("ModeAppend = ", os.ModeAppend)
	Println("ModeExclusive = ", os.ModeExclusive)
	Println("ModeTemporary = ", os.ModeTemporary)
	Println("ModeSymlink = ", os.ModeSymlink)
	Println("ModeDevice = ", os.ModeDevice)
	Println("ModeNamedPipe = ", os.ModeNamedPipe)
	Println("ModeSocket = ", os.ModeSocket)
	Println("ModeSetuid = ", os.ModeSetuid)
	Println("ModeSetgid = ", os.ModeSetgid)
	Println("ModeCharDevice = ", os.ModeCharDevice)
	Println("ModeSticky = ", os.ModeSticky)

	logger := logging.NewLogger("f**k")
	logger.LogToFile()

	// _ = logger
	// logger.SetLevel(20)

	logger.Debug("f**k中文")
}
Beispiel #2
0
package logger

import (
	"ml/logging"
	"ml/os2"
)

var (
	logger      = logging.NewLogger(os2.ExecutableName())
	Debug       = logger.Debug
	Info        = logger.Info
	Warning     = logger.Warning
	Error       = logger.Error
	Fatal       = logger.Fatal
	SetLevel    = logger.SetLevel
	Level       = logger.Level
	SetFormater = logger.SetFormater
	LogToFile   = logger.LogToFile
)

func init() {
	logger.SetSkip(1)
}