Exemple #1
0
package main

import (
	"github.com/mabetle/mlog"
	"github.com/mabetle/mlog/wlog"
)

var (
	mlogApiLogger  = mlog.GetLogger("mlogApiLogger")         // api
	mlogWrapLogger = mlog.GetWrapLogger("mlogWrapLogger")    // mlog
	wlogApiLogger  = wlog.NewLogger("wlogApiLogger", 5)      // api
	wlogWrapLogger = wlog.NewWrapLogger("wlogWrapLogger", 5) //
)

func Demo() {
	mlogWrapLogger.Trace("Hello")
	mlogWrapLogger.Debug("Hello")
	mlogWrapLogger.Info("Hello")
	mlogWrapLogger.Warn("Hello")
	mlogWrapLogger.Error("Hello")

	mlogWrapLogger.Inspect()

	//wlogApiLogger.Error("Hello")
	//wlogWrapLogger.Error("Hello")
}

func main() {
	//mlog.SetTraceLevel()
	mlog.SetDebugLevel()
	//mlog.SetInfoLevel()
Exemple #2
0
// GetApiLogger valid wlog implements Logger API
func GetApiLogger(catalog string) logapi.Logger {
	return wlog.NewLogger(catalog, 5)
}