Browse Source

Added logging

Jaime van Kessel 9 years ago
parent
commit
3b66e887b0
1 changed files with 4 additions and 1 deletions
  1. 4 1
      plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py

+ 4 - 1
plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py

@@ -9,7 +9,7 @@ from UM.Message import Message
 from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
 
 from . import RemovableDriveOutputDevice
-
+from UM.Logger import Logger
 from UM.i18n import i18nCatalog
 catalog = i18nCatalog("cura")
 
@@ -38,11 +38,14 @@ class RemovableDrivePlugin(OutputDevicePlugin):
 
     def ejectDevice(self, device):
         try:
+            Logger.log("i", "Attempting to eject the device")
             result = self.performEjectDevice(device)
         except Exception as e:
+            Logger.log("e", "Ejection failed due to: %s" % str(e))
             result = False
 
         if result:
+            Logger.log("i", "Succesfully ejected the device")
             message = Message(catalog.i18nc("@info:status", "Ejected {0}. You can now safely remove the drive.").format(device.getName()))
             message.show()
         else: