aboutsummaryrefslogtreecommitdiffstats
path: root/backend/magiback
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2019-08-18 21:07:32 +0200
committerPapoteur <papoteur@mageia.org>2019-08-18 21:07:32 +0200
commit2fd705f8417f95d55e5cbd7b728b51dba0ac1162 (patch)
treeffca78b317eda5be4f0c522e7ab5df2e522a6552 /backend/magiback
parent03b917c1fb49484f64f5a1352f2214979d06a40d (diff)
downloadisodumper-2fd705f8417f95d55e5cbd7b728b51dba0ac1162.tar
isodumper-2fd705f8417f95d55e5cbd7b728b51dba0ac1162.tar.gz
isodumper-2fd705f8417f95d55e5cbd7b728b51dba0ac1162.tar.bz2
isodumper-2fd705f8417f95d55e5cbd7b728b51dba0ac1162.tar.xz
isodumper-2fd705f8417f95d55e5cbd7b728b51dba0ac1162.zip
Add more logging
Diffstat (limited to 'backend/magiback')
-rwxr-xr-xbackend/magiback11
1 files changed, 7 insertions, 4 deletions
diff --git a/backend/magiback b/backend/magiback
index e1ec093..6bf0202 100755
--- a/backend/magiback
+++ b/backend/magiback
@@ -10,7 +10,8 @@ import logging
DEAMON_ORG = 'org.mageia.Magiback'
DEAMON_INTERFACE = DEAMON_ORG
ISODUMPER_INTERFACE = DEAMON_ORG + ".Isodumper"
-logging.basicConfig(filename="/var/log/magiback.log",level=logging.DEBUG)
+logging.basicConfig(filename="/var/log/magiback.log",format='%(asctime)s %(levelname)-8s %(message)s',
+ datefmt='%Y-%m-%d %H:%M:%S',level=logging.DEBUG)
class Isodumper(raw_write.Dumper):
"""
@@ -61,6 +62,7 @@ class Isodumper(raw_write.Dumper):
# Call translation catalog
gettext.install(APP, localedir=DIR,)
self.finished = threading.Event()
+ # finished is cleared at start of operation, and set at the end
self.finished.clear()
self._progress = 0
self.loop = GLib.MainLoop()
@@ -84,7 +86,8 @@ class Isodumper(raw_write.Dumper):
self.writing_perm = True
self.writing_target = target
else:
- self.return_message = "Access denied"
+ self.return_message = "Writing: Access denied"
+ logging.debug(self.return_message)
self.finished.set()
def do_persistence(self, target, label):
@@ -92,7 +95,7 @@ class Isodumper(raw_write.Dumper):
if self.writing_perm and self.writing_target == target :
self._do_persistence(target, label)
else:
- self.return_message = "Access denied"
+ self.return_message = "Persistence: Access denied"
self.writing_perm = False
self.writing_target = ""
@@ -120,7 +123,6 @@ class Isodumper(raw_write.Dumper):
return self._progress
def do_unmount(self, device):
- print("Unmounting")
return self._do_unmount([device])
def get_sum(self, source):
@@ -191,3 +193,4 @@ if __name__ == '__main__':
("Isodumper", Isodumper()))
loop = GLib.MainLoop()
loop.run()
+ logging.shutdown()