mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 18:49:01 +08:00
Added logging
This commit is contained in:
parent
34ed642e35
commit
3b66e887b0
@ -9,7 +9,7 @@ from UM.Message import Message
|
|||||||
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
||||||
|
|
||||||
from . import RemovableDriveOutputDevice
|
from . import RemovableDriveOutputDevice
|
||||||
|
from UM.Logger import Logger
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
@ -38,11 +38,14 @@ class RemovableDrivePlugin(OutputDevicePlugin):
|
|||||||
|
|
||||||
def ejectDevice(self, device):
|
def ejectDevice(self, device):
|
||||||
try:
|
try:
|
||||||
|
Logger.log("i", "Attempting to eject the device")
|
||||||
result = self.performEjectDevice(device)
|
result = self.performEjectDevice(device)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Logger.log("e", "Ejection failed due to: %s" % str(e))
|
||||||
result = False
|
result = False
|
||||||
|
|
||||||
if result:
|
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 = Message(catalog.i18nc("@info:status", "Ejected {0}. You can now safely remove the drive.").format(device.getName()))
|
||||||
message.show()
|
message.show()
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user