func (f *Facility) Logf(logName string, wantLevel Level, fields bark.Fields, format string, msg []interface{}) {
	f.mu.RLock()
	defer f.mu.RUnlock()
	if setLevel, ok := f.levels[logName]; ok {
		if setLevel < wantLevel {
			return
		}
	}
	logger := f.logger
	if len(fields) > 0 {
		logger = logger.WithFields(fields)
	}
	switch wantLevel {
	case Debug:
		logger.Debugf(format, msg...)
	case Info:
		logger.Infof(format, msg...)
	case Warn:
		logger.Warnf(format, msg...)
	case Error:
		logger.Errorf(format, msg...)
	case Fatal:
		logger.Fatalf(format, msg...)
	case Panic:
		logger.Panicf(format, msg...)
	}
}
Logf is the same as Log but with fmt.Printf-like formatting
package logging
import (
	"fmt"
	"sync"
	"github.com/uber-common/bark"
)
type Facility struct {
	logger bark.Logger
	levels map[string]Level
	mu sync.RWMutex
}
func NewFacility(log bark.Logger) *Facility {
	if log == nil {
		log = NoLogger
	}
	return &Facility{
		logger: log,
		levels: make(map[string]Level),
	}
}
func (f *Facility) SetLevels(levels map[string]Level) error {
	for logName, level := range levels {
		if level < Fatal {
			return fmt.Errorf("cannot set a level above %s for %s", Fatal, logName)
		}
	}
	f.mu.Lock()
	defer f.mu.Unlock()
	for logName, level := range levels {
		f.levels[logName] = level
	}
	return nil
}
func (f *Facility) SetLevel(logName string, level Level) error {
	if level < Fatal {
		return fmt.Errorf("cannot set a level above %s for %s", Fatal, logName)
	}
	f.mu.Lock()
	defer f.mu.Unlock()
	f.levels[logName] = level
	return nil
}
func (f *Facility) SetLogger(log bark.Logger) {
	f.mu.Lock()
	defer f.mu.Unlock()
	if log == nil {
		log = NoLogger
	}
	f.logger = log
}
func (f *Facility) Logger(logName string) bark.Logger {
	return &namedLogger{
		name:      logName,
		forwardTo: f,
	}
}
func (f *Facility) Log(logName string, wantLevel Level, fields bark.Fields, msg []interface{}) {
	f.mu.RLock()
	defer f.mu.RUnlock()
	if setLevel, ok := f.levels[logName]; ok {
		if setLevel < wantLevel {
			return
		}
	}
	logger := f.logger
	if len(fields) > 0 {
		logger = logger.WithFields(fields)
	}
	switch wantLevel {
	case Debug:
		logger.Debug(msg...)
	case Info:
		logger.Info(msg...)
	case Warn:
		logger.Warn(msg...)
	case Error:
		logger.Error(msg...)
	case Fatal:
		logger.Fatal(msg...)
	case Panic:
		logger.Panic(msg...)
	}
}