func (l *Log) Errorf(format string, args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.ERROR)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Errorf(format, args...)
		return
	}
	l.logf(opts, apilogging.ERROR, format, args...)
}
Errorf calls go log.Output.
Arguments are handled in the manner of fmt.Printf.
package modlog
import (
	"fmt"
	"log"
	"os"
	"path/filepath"
	"runtime"
	"strings"
	"sync"
	"io"
	"sync/atomic"
	"github.com/hyperledger/fabric-sdk-go/api/apilogging"
	"github.com/hyperledger/fabric-sdk-go/pkg/logging/decorator"
	"github.com/hyperledger/fabric-sdk-go/pkg/logging/utils"
)
var rwmutex = &sync.RWMutex{}
var moduleLevels = &decorator.ModuleLevels{}
var callerInfos = &decorator.CallerInfo{}
var useCustomLogger int32
var loggerProviderInstance apilogging.LoggerProvider
var loggerProviderOnce sync.Once
type Provider struct {
}
func (p *Provider) GetLogger(module string) apilogging.Logger {
	newDefLogger := log.New(os.Stdout, fmt.Sprintf(logPrefixFormatter, module), log.Ldate|log.Ltime|log.LUTC)
	return &Log{deflogger: newDefLogger, module: module}
}
func LoggerProvider() apilogging.LoggerProvider {
	return &Provider{}
}
func InitLogger(l apilogging.LoggerProvider) {
	loggerProviderOnce.Do(func() {
		loggerProviderInstance = l
		atomic.StoreInt32(&useCustomLogger, 1)
	})
}
type Log struct {
	deflogger    *log.Logger
	customLogger apilogging.Logger
	module       string
	custom       bool
	once         sync.Once
}
type loggerOpts struct {
	levelEnabled      bool
	callerInfoEnabled bool
}
const (
	logLevelFormatter   = "UTC %s-> %4.4s "
	logPrefixFormatter  = " [%s] "
	callerInfoFormatter = "- %s "
)
func SetLevel(module string, level apilogging.Level) {
	rwmutex.Lock()
	defer rwmutex.Unlock()
	moduleLevels.SetLevel(module, level)
}
func GetLevel(module string) apilogging.Level {
	rwmutex.RLock()
	defer rwmutex.RUnlock()
	return moduleLevels.GetLevel(module)
}
func IsEnabledFor(module string, level apilogging.Level) bool {
	rwmutex.RLock()
	defer rwmutex.RUnlock()
	return moduleLevels.IsEnabledFor(module, level)
}
func ShowCallerInfo(module string, level apilogging.Level) {
	rwmutex.Lock()
	defer rwmutex.Unlock()
	callerInfos.ShowCallerInfo(module, level)
}
func HideCallerInfo(module string, level apilogging.Level) {
	rwmutex.Lock()
	defer rwmutex.Unlock()
	callerInfos.HideCallerInfo(module, level)
}
func getLoggerOpts(module string, level apilogging.Level) *loggerOpts {
	rwmutex.RLock()
	defer rwmutex.RUnlock()
	return &loggerOpts{
		levelEnabled:      moduleLevels.IsEnabledFor(module, level),
		callerInfoEnabled: callerInfos.IsCallerInfoEnabled(module, level),
	}
}
func (l *Log) Fatal(args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.CRITICAL)
	if l.loadCustomLogger() {
		l.customLogger.Fatal(args...)
		return
	}
	l.log(opts, apilogging.CRITICAL, args...)
	l.deflogger.Fatal(args...)
}
func (l *Log) Fatalf(format string, args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.CRITICAL)
	if l.loadCustomLogger() {
		l.customLogger.Fatalf(format, args...)
		return
	}
	l.logf(opts, apilogging.CRITICAL, format, args...)
	l.deflogger.Fatalf(format, args...)
}
func (l *Log) Fatalln(args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.CRITICAL)
	if l.loadCustomLogger() {
		l.customLogger.Fatalln(args...)
		return
	}
	l.logln(opts, apilogging.CRITICAL, args...)
	l.deflogger.Fatalln(args...)
}
func (l *Log) Panic(args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.CRITICAL)
	if l.loadCustomLogger() {
		l.customLogger.Panic(args...)
		return
	}
	l.log(opts, apilogging.CRITICAL, args...)
	l.deflogger.Panic(args...)
}
func (l *Log) Panicf(format string, args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.CRITICAL)
	if l.loadCustomLogger() {
		l.customLogger.Panicf(format, args...)
		return
	}
	l.logf(opts, apilogging.CRITICAL, format, args...)
	l.deflogger.Panicf(format, args...)
}
func (l *Log) Panicln(args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.CRITICAL)
	if l.loadCustomLogger() {
		l.customLogger.Panicln(args...)
		return
	}
	l.logln(opts, apilogging.CRITICAL, args...)
	l.deflogger.Panicln(args...)
}
func (l *Log) Print(args ...interface{}) {
	if l.loadCustomLogger() {
		l.customLogger.Print(args...)
		return
	}
	l.deflogger.Print(args...)
}
func (l *Log) Printf(format string, args ...interface{}) {
	if l.loadCustomLogger() {
		l.customLogger.Printf(format, args...)
		return
	}
	l.deflogger.Printf(format, args...)
}
func (l *Log) Println(args ...interface{}) {
	if l.loadCustomLogger() {
		l.customLogger.Println(args...)
		return
	}
	l.deflogger.Println(args...)
}
func (l *Log) Debug(args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.DEBUG)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Debug(args...)
		return
	}
	l.log(opts, apilogging.DEBUG, args...)
}
func (l *Log) Debugf(format string, args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.DEBUG)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Debugf(format, args...)
		return
	}
	l.logf(opts, apilogging.DEBUG, format, args...)
}
func (l *Log) Debugln(args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.DEBUG)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Debugln(args...)
		return
	}
	l.logln(opts, apilogging.DEBUG, args...)
}
func (l *Log) Info(args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.INFO)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Info(args...)
		return
	}
	l.log(opts, apilogging.INFO, args...)
}
func (l *Log) Infof(format string, args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.INFO)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Infof(format, args...)
		return
	}
	l.logf(opts, apilogging.INFO, format, args...)
}
func (l *Log) Infoln(args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.INFO)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Infoln(args...)
		return
	}
	l.logln(opts, apilogging.INFO, args...)
}
func (l *Log) Warn(args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.WARNING)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Warn(args...)
		return
	}
	l.log(opts, apilogging.WARNING, args...)
}
func (l *Log) Warnf(format string, args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.WARNING)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Warnf(format, args...)
		return
	}
	l.logf(opts, apilogging.WARNING, format, args...)
}
func (l *Log) Warnln(args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.WARNING)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Warnln(args...)
		return
	}
	l.logln(opts, apilogging.WARNING, args...)
}
func (l *Log) Error(args ...interface{}) {
	opts := getLoggerOpts(l.module, apilogging.ERROR)
	if !opts.levelEnabled {
		return
	}
	if l.loadCustomLogger() {
		l.customLogger.Error(args...)
		return
	}
	l.log(opts, apilogging.ERROR, args...)
}