func Panic(msg string, args ...interface{}) {
	AppLog.Panic(msg, args...)
}
Panic writes the log message and then panics.
package log
import (
	"io"
	"os"
	"path/filepath"
	"go.uber.org/zap/zapcore"
	"gopkg.in/natefinch/lumberjack.v2"
	"go.uber.org/zap"
)
const mainLoggerName = "00000.defaultLogger"
var debugMode = false
var jsonLog = false
var debugLevel = zap.LevelEnablerFunc(func(lvl zapcore.Level) bool {
	return lvl >= zapcore.DebugLevel
})
var infoLevel = zap.LevelEnablerFunc(func(lvl zapcore.Level) bool {
	return lvl >= zapcore.InfoLevel
})
func logLevel() zap.LevelEnablerFunc {
	if debugMode {
		return debugLevel
	}
	return infoLevel
}
func Level() zapcore.Level {
	if debugMode {
		return zapcore.DebugLevel
	}
	return zapcore.InfoLevel
}
type Logger interface {
	Info(format string, args ...interface{})
	Debug(format string, args ...interface{})
	Error(format string, args ...interface{})
	Warning(format string, args ...interface{})
	WithName(prefix string) Log
}
func encoder() zapcore.Encoder {
	if jsonLog {
		return zapcore.NewJSONEncoder(zap.NewDevelopmentEncoderConfig())
	}
	return zapcore.NewConsoleEncoder(zap.NewDevelopmentEncoderConfig())
}
var AppLog Log
func init() {
	AppLog = NewDefault(mainLoggerName)
}
func DebugMode(mode bool) {
	debugMode = mode
}
func JSONLog(b bool) {
	jsonLog = b
}
func New(module string, dataFolderPath string, logFileName string) Log {
	var cores []zapcore.Core
	consoleSyncer := zapcore.AddSync(os.Stdout)
	enc := encoder()
	cores = append(cores, zapcore.NewCore(enc, consoleSyncer, logLevel()))
	if dataFolderPath != "" && logFileName != "" {
		wr := getFileWriter(dataFolderPath, logFileName)
		fs := zapcore.AddSync(wr)
		cores = append(cores, zapcore.NewCore(enc, fs, debugLevel))
	}
	core := zapcore.NewTee(cores...)
	log := zap.New(core)
	log = log.Named(module)
	lvl := zap.NewAtomicLevelAt(Level())
	return Log{log, log.Sugar(), &lvl}
}
func NewDefault(module string) Log {
	return New(module, "", "")
}
func getFileWriter(dataFolderPath, logFileName string) io.Writer {
	fileName := filepath.Join(dataFolderPath, logFileName)
	fileLogger := &lumberjack.Logger{
		Filename:   fileName,
		MaxSize:    500,  
		MaxBackups: 3,
		MaxAge:     28,  
		Compress:   false,
	}
	return fileLogger
}
func InitlibonomyLoggingSystem(dataFolderPath string, logFileName string) {
	AppLog = NewDefault(mainLoggerName)
}
func Info(msg string, args ...interface{}) {
	AppLog.Info(msg, args...)
}
func Debug(msg string, args ...interface{}) {
	AppLog.Debug(msg, args...)
}
func Error(msg string, args ...interface{}) {
	AppLog.Error(msg, args...)
}
func Warning(msg string, args ...interface{}) {
	AppLog.Warning(msg, args...)
}
func With() FieldLogger {
	return FieldLogger{AppLog.logger}
}
func Event() FieldLogger {
	return AppLog.Event()
}