64 lines
1.4 KiB
Go
64 lines
1.4 KiB
Go
|
package logger
|
||
|
|
||
|
import "go.uber.org/zap"
|
||
|
|
||
|
type WailsZapLoggerAdaptor struct {
|
||
|
logger *zap.SugaredLogger
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Print(message string) {
|
||
|
w.logger.Info(message)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Trace(message string) {
|
||
|
w.logger.Error(message)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Debug(message string) {
|
||
|
w.logger.Debug(message)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Debugf(template string, args ...interface{}) {
|
||
|
w.logger.Debugf(template, args...)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Info(message string) {
|
||
|
w.logger.Info(message)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Infof(template string, args ...interface{}) {
|
||
|
w.logger.Infof(template, args...)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Warning(message string) {
|
||
|
w.logger.Warn(message)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Warn(message string) {
|
||
|
w.Warning(message)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Warnf(message string, args ...interface{}) {
|
||
|
w.logger.Warnf(message, args...)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Error(message string) {
|
||
|
w.logger.Error(message)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Errorln(err error) {
|
||
|
w.logger.Error(err)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Errorf(template string, args ...interface{}) {
|
||
|
w.logger.Errorf(template, args...)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Fatal(message string) {
|
||
|
w.logger.Fatal(message)
|
||
|
}
|
||
|
|
||
|
func (w *WailsZapLoggerAdaptor) Fatalf(message string, args ...interface{}) {
|
||
|
w.logger.Fatalf(message, args...)
|
||
|
}
|