From 15aa090b628a52d0e68bebac87de5f1bf14c68bd Mon Sep 17 00:00:00 2001 From: electricface Date: Tue, 23 Jul 2019 10:09:49 +0800 Subject: [PATCH] fix: build failed --- bin/dde-greeter-setter/main.go | 4 ++-- bin/search/data_rw.go | 5 +++-- bluetooth/bluetooth.go | 2 +- bluetooth/bluetooth_ifc.go | 4 ++-- grub2/grub2.go | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/dde-greeter-setter/main.go b/bin/dde-greeter-setter/main.go index 359518999..6f3e82dfd 100644 --- a/bin/dde-greeter-setter/main.go +++ b/bin/dde-greeter-setter/main.go @@ -41,13 +41,13 @@ func main() { err = service.Export(dbusPath, m) if err != nil { - logger.Errorf("failed to export:", err) + logger.Error("failed to export:", err) return } err = service.RequestName(dbusServiceName) if err != nil { - logger.Errorf("failed to request name:", err) + logger.Error("failed to request name:", err) return } service.SetAutoQuitHandler(time.Second*30, nil) diff --git a/bin/search/data_rw.go b/bin/search/data_rw.go index 85bdd1a35..f814ee755 100644 --- a/bin/search/data_rw.go +++ b/bin/search/data_rw.go @@ -24,6 +24,7 @@ import ( "encoding/gob" "io/ioutil" "os" + dutils "pkg.deepin.io/lib/utils" ) @@ -42,7 +43,7 @@ func writeDatasToFile(datas interface{}, filename string) { fp, err := os.Create(filename) if err != nil { - logger.Warning("Open '%s' failed:", err) + logger.Warningf("failed to open %q: %v", filename, err) return } defer fp.Close() @@ -59,7 +60,7 @@ func readDatasFromFile(datas interface{}, filename string) bool { contents, err := ioutil.ReadFile(filename) if err != nil { - logger.Warning("ReadFile '%s' failed:", err) + logger.Warningf("failed to read file %q: %v", filename, err) return false } diff --git a/bluetooth/bluetooth.go b/bluetooth/bluetooth.go index 98698e0fe..53a7b59d8 100644 --- a/bluetooth/bluetooth.go +++ b/bluetooth/bluetooth.go @@ -332,7 +332,7 @@ func (b *Bluetooth) addDevice(dpath dbus.ObjectPath) { b.adaptersLock.Unlock() if d.adapter == nil { - logger.Warning("failed to add device %s, not found adapter", dpath) + logger.Warningf("failed to add device %s, not found adapter", dpath) return } diff --git a/bluetooth/bluetooth_ifc.go b/bluetooth/bluetooth_ifc.go index 41033f44c..936fd2146 100644 --- a/bluetooth/bluetooth_ifc.go +++ b/bluetooth/bluetooth_ifc.go @@ -33,7 +33,7 @@ func (b *Bluetooth) RemoveDevice(apath, dpath dbus.ObjectPath) *dbus.Error { err = a.core.RemoveDevice(0, dpath) if err != nil { - logger.Warning("failed to remove device %q from adapter %q: %v", + logger.Warningf("failed to remove device %q from adapter %q: %v", dpath, apath, err) return dbusutil.ToError(err) } @@ -136,7 +136,7 @@ func (b *Bluetooth) SetAdapterPowered(apath dbus.ObjectPath, if powered { err := a.core.Discoverable().Set(0, b.config.Discoverable) if err != nil { - logger.Warning("failed to set discoverable for %s: %v", a, err) + logger.Warningf("failed to set discoverable for %s: %v", a, err) } err = a.core.StartDiscovery(0) if err != nil { diff --git a/grub2/grub2.go b/grub2/grub2.go index 712cca73d..0aa68008a 100644 --- a/grub2/grub2.go +++ b/grub2/grub2.go @@ -380,7 +380,7 @@ func (grub *Grub2) readEntries() (err error) { return } if len(grub.entries) == 0 { - logger.Warning("there is no menu entry in %s", grubScriptFile) + logger.Warningf("there is no menu entry in %s", grubScriptFile) } return }