Commits

Moises Henriquez committed bfa2897

Added logging on GTK+2 ui

  • Participants
  • Parent commits 12a0118

Comments (0)

Files changed (17)

File modules/bootloaders.py

 from support import widgets
 from support import dialogs
 from support.vectorlinux import BOOTLOADERS, FSTAB
-from support.vectorlinux.utils import _, get_popen, logger
+from support.vectorlinux.utils import _, get_popen
 import threading
 import time
+import logging
+
+logger = logging.getLogger('vasm')
 
 
 # some constans for the actions to be performed here
             methods.append(self.blobject.install)
         
         # execute the methods
-        for f in methods:                
+        for f in methods:
             logger.debug("Executing %s"% f)
             try:
                 f()
             except AssertionError, e:
                 self._errors = True
                 self.flag.set()
-                logger.fatal("%s"%e)
+                logger.error("%s"%e)
             time.sleep(1)
     
     def pulse_pb(self):
         
         self.button.set_property('sensitive', True)
         return self.indicate_done()
-        # change the text of the message
-        #self.progressbar.set_text(_("All operations complete."))
-        #self.message = (_("All operations were performed."),
-        #    _("Reboot your system to see your changes."))
-        #self.label.set_markup(" ".join(self.message))
-        
-        
+
     def indicate_done(self):
         """ Change the dialog's contents according to the results """
         self.progressbox.set_property('visible', False)
             msg = (_("Changes were applied successfully."))
         
         self.label.set_markup("".join(msg))
-        
-        
-        
+
 
 class VectorBootLoaders(widgets.VasmModule):
     def __init__(self, parent):
                 _("Something went wrong during the lilo setup."),
                 " ", _("See /var/log/vasm.log for details"))
             return dialogs.error(" ".join(msg), parent=self._parent)
-        #return dialogs.info(
-        #    _("All operations succeeded.  Reboot to see your changes."),
-        #    parent = self._parent)
     
     def apply_grub2_event(self, button=None):
         """ Apply event for when grub2 is the selected bootloader """
                 _("Something went wrong during the grub2 setup."),
                 " ", _("See /var/log/vasm.log for details"))
             return dialogs.error("".join(msg), parent = self._parent)
-        #return dialogs.info(
-        #    _("No errors where reported.  Reboot to see your changes."),
-        #    parent = self._parent)
     
     def vgaquality_toggle(self, combobox):
         """ Set the vga quality to the selected value """

File modules/bootmode.py

 from support import widgets
 from support.vectorlinux import BOOTMODE
 from support.vectorlinux.utils import _
+import logging
+
+logger = logging.getLogger('vasm')
 
 # vasm flags
 VASM_CATEGORY = "%s/%s"% (_("System"), _("Startup Options"))
         value = self._get_selected_initvalue()
         try:
             self.datamodel.setMode(value)
+            logger.info("Bootmode set to %s"% value)
         except IOError, (errorno, errormsg):
             if errorno == 13:
+                logger.error("Error while setting bootmode. %s"%errormsg)
                 return dialogs.error(
                     _("Unable to gain write permissions to /etc/inittab."),
-                    parent=self._parent)        
+                    parent=self._parent)
         return dialogs.info(_(
             "The default boot method has been changed to init level") + " " + value +\
            ".  " + _( "The changes will be reflected after the computer restarts."),

File modules/dateset.py

 from support import widgets
 from support.vectorlinux import DATESET
 from support.vectorlinux.utils import _
+import logging
+
+logger = logging.getLogger('vasm')
 
 class DateTimeDialog(widgets.VasmModule):
     def __init__(self, parent):
         """ Save all settings. """
         try:
             self._set_date()
+            logger.debug("Saved date settings.")
         except DATESET.DateTimeError as e:
+            logger.error("Error saving date settings. %s"% e)
             return dialogs.error(
                 "%s \n\n%s"% (
                     _("Failed to set the sytem date."),
                 )
         try:
             self._set_time()
+            logger.debug("Saved time settings.")
         except DATESET.DateTimeError as e:
+            logger.error("Error while saving system time settings. %s"% e)
             return dialods.error(
                 "%s \n\n%s"% (
                     _("Failed to set the system time."), e
 
         try:
             self._set_hwclock_setting()
+            logger.debug("Saved system hardware clock settings.")
         except IOError as e:
             # unable to lock the file
+            logger.error("Unable to save hardware clock settings. %s"% e)
             return dialogs.error(
                 "%s \n\n%s"%
                 (_("Unable to save hardware clock setting."), e)
                 )
         except AssertionError as e:
+            logger.error("Unable to save hardware clock settings. %s"% e)
             return dialogs.error(
                 _("Unable to save the hardware clock setting") + \
                 "\n\n" % e
                 )
         try:
             self._set_timezone()
+            logger.debug("Saved timezone settings")
         except IOError as e:
+            logger.error("Unable to save timezone setting. %s"% e)
             return dialogs.error(
                 "%s \n\n %s"% (
                     _("Unable to save timezone setting."), e
             _("Settings successfully saved.")
             )
         return self.close_module()
-        
-
 
 def __vasm_test__():
     """ Make this available to root only """

File modules/loginmanager.py

 from support import dialogs
 from support.vectorlinux import LOGINMANAGERS
 from support.vectorlinux.utils import _
+import logging
+
+logger = logging.getLogger('vasm')
 
 __author__ = "Moises Henriquez"
 __author_email__ = "moc.liamg@xnl.E0M"[::-1]
         """ Save changes to the system """
         manager = self.selected_loginmanager.lower()
         # The backend will respond with True if it goes trhough, False otherwise.
-        res = LOGINMANAGERS.LoginManagers().set_manager(manager)
-        if res :
+        try:
+            LOGINMANAGERS.LoginManagers().set_manager(manager)
+            logger.debug("System login manager set to %s"% manager)
             msg = (
-                _("The system login manager has been set to"), manager + "."," ",
-                _("You will see the changes applied when your system restarts.")
-            )
-            return dialogs.info(' '.join(msg), parent=self._parent)
-        else:
+                _("The system login manager has been set to"), " %s "% manager,
+                ".  ", 
+                _("You will see the changes applied when your system restarts."))
+            return dialogs.info(''.join(msg))
+        except AssertionError, e:
+            logger.error("Error trying to save login manger %s"% e)
             msg = (
-                _("Unable to set login manager.")," ",
-                _("Make sure your /etc/rc.d/rc.X is OK"))
-            return dialogs.error(' '.join(msg), parent = self._parent)
+            _("Unable to save login manager settings."), e)
+            return dialogs.error("".join(msg))
+        except IOError, (errorno, errormsg):
+            logger.error("Error trying to save login manager settings %s"% errormsg)
+            msg = (_("Unable to save login manager settings."), errormsg)
+            return dialogs.error("".join(msg))
 
     def update_selection(self, treeview):
         """ Update the selected login manager """

File modules/password.py

 from support import dialogs
 from support.vectorlinux import PASSWORDS
 from support.vectorlinux.utils import _
+import logging
+
+logger = logging.getLogger('vasm')
 
 __author__ = "Moises Henriquez"
 __author_email__ = "moc.liamg@xnl.E0M"[::-1]
         
         try:
             PASSWORDS.change_password(self.for_user, oldpass, newpass)
+            logger.debug("Changed password for %s"% self.for_user)
         except PASSWORDS.BadPasswordException:
             self.clear_form()
             msg = (
                 _("The current password you entered is incorrect."), " ",
                 _("Your password remains unchanged.")
             )
+            logger.error("Unable to password for %s.  The current password is wrong."% self.for_user)
             return dialogs.error(' '.join(msg), title=_("Bad password"),
                                  parent = self._parent)
         except PASSWORDS.BadNewPasswordException:
                 _("Passwords should be at least 6 characters long and contain"),
                 _("a mixture of upper and lower case letters and numbers.")
             )
+            logger.error("Unable to change password for %s.  Bad new password."% self.for_user)
             return dialogs.error(' '.join(msg),
                                  parent = self._parent, title=_("Bad Password"))
         else:

File modules/pyfstab.py

 from support import widgets
 from support.vectorlinux import FSTAB
 from support.vectorlinux.utils import _
+import logging
 
+logger = logging.getLogger('vasm')
 
 # vasm flags
 
         if ret == gtk.RESPONSE_YES:
             try:
                 self.datamodel.removeEntry(selected)
+                logger.debug("Deleted %s from /etc/fstab"%selected)
             except AssertionError as e:
+                logger.error("Unable to remove %s from /etc/fstab. %s"% (selected, e))
                 return dialogs.error(
                     _("Unable to delete this entry") + "  \n\n" + e)
         # Simply return if the user backs out
         if not self.entryobject:
             return
         self.entryobject._mount_now = widget.get_active()
-        print widget.get_active()
 
     def targetbox_change_event(self, widget=None):
         self.entryobject.mountpoint = widget.get_text()
         self.entryobject = FSTAB.FstabEntry(sel)
         self.entryobject.filesystem = self.entryobject.find_filesystem()
         self.entryobject.options = self.entryobject.find_default_options()
-        #        fs = self.entryobject.find_filesystem()
-        #        options = self.entryobject.find_default_options()
         # set the filesystem text on a label for informational puposes.
         self.fslabel.set_label(self.entryobject.filesystem)
         # set the default options
                 )
         try:
             self.fstabmodel.addEntry(self.entryobject)
+            logger.debug("Added %s to /etc/fstab"% self.entryobject.device)
         except AssertionError as e:
+            logger.error("Unable to add %s to %s"% (self.entryobject.device, e))
             return dialogs.error(
                 _("Unable to add entry.") + " \n\n" + e)
         # Create the mountpoint if it does not exist

File modules/repos.py

 from support.vectorlinux.utils import _
 from support import widgets
 from support import dialogs
+import logging
+
+logger = logging.getLogger('vasm')
 
 # vasm flags
 VASM_CATEGORY = _("System")
         changes = []
         for item in treemodel:
             changes.append((item[0], item[2], item[3]))
-        
-        if self.datamodel.save_changes(changes):
-            # if this has a value, something went wrong
-            dialogs.error(_("Error while saving changes... see /etc/slapt-get/slapt-getrc.bak"))
-        else:
-            dialogs.info(_("Your changes were successfully saved."))
-        return
+        try:
+            self.datamodel.save_changes(changes)
+            logger.debug("Updated /etc/slapt-get/slapt-getrc")
+        except IOError, (errorno, errormsg):
+            logger.error("Unable to save changes to /etc/slapt-get/slapt-getrc. %s"%errormsg + \
+            " A copy of your original slapt-getrc file was saved to /etc/slapt-get/slapt-getrc.bak")
+            return dialogs.error(
+                _("Error while saving changes.  See /var/log/vasm.log"))
+        return dialogs.info(_("Your changes were saved to /etc/slapt-get/slapt-getrc"))
     
     def priority_edit_event(self,combo, path, text, treemodel):
         """ Set what happens when the priority on a repo is changed"""

File modules/rootpass.py

 import os
 from support.vectorlinux.utils import _
 import password
+import logging
+
+logger = logging.getLogger('vasm')
 
 __author__ = "Moises Henriquez"
 __author_email__ = "moc.liamg@xnl.E0M"[::-1]
 
-
-
 # vasm flags
 
 VASM_CATEGORY=_("System")
     ui.title = VASM_LABEL
     ui.launch()
     return ui.newpass1.entry.grab_focus()
-
-
-
-

File modules/services.py

 import gobject
 import threading
 import time
+import logging
+
+logger = logging.getLogger('vasm')
 
 gobject.threads_init()
 # vasm flags
             # 3 = Runlevel 3 value
             # 4 = Runlevel 4 value
             # 5 = Runlevel 5 value
-        #self.done = False
-        #self.barthread = threading.Thread(target=self.pulse_bar)
         
         # Disable parent widgets to avoid double interaction
         self.disable_widgets()
             for rl in range(2, 6):
                 if row[rl] is True:
                     self.message = "Enabling %s for runlevel %s"%(service, rl)
+                    logger.debug(self.message)
                     rcode, output = self.servicemodel.enable_service(service, rl)
                     if rcode > 0:
                         errors = True
                         self.parent.errors = True
                 else:
                     self.message = "Disabling %s for runlevel %s"% (service, rl)
+                    logger.debug(self.message)
                     rcode, output = self.servicemodel.disable_service(service, rl)
                     if rcode > 0:
                         errors = True

File modules/skel.py

 from support.vectorlinux import SKEL
 from support.vectorlinux import USERADMIN
 from support.vectorlinux.utils import _
+import logging
+
+logger = logging.getLogger('vasm')
 
 __author__ = "Moises Henriquez"
 __author_email__ = "moc.liamg@xnl.E0M"[::-1]
         iten = model.get_iter(path)
         model.set_value(iten, 0, not cell.get_active())
         self.btapply.set_property('sensitive', len(self._get_reset_list()) > 0)
-        
     
     def _get_reset_list(self):
         """ Return a list of settings to be wiped """
         reset = self._get_reset_list()
         try:
             self.skelmodel.reset_settings(reset)
+            logger.debug("Personal settings for %s have been wiped"% self.skelmodel.login)
         except AssertionError as e:
+            logger.error("Error resetting personal settigs. %s"% e)
             return dialogs.error(
                 _("An error has occurred!") + "  \n\n%s"% e,
                 parent = self._parent
                 )
-        except Error as e:
-            return dialogs.error(
-                _("There was an error reverting settings") + "\n\n%s"% e,
-                parent = self._parent
-                )
         except OSError as e:
+            logger.error("Error resetting personal settigs. %s"% e)
             return dialogs.error(
                 _("An error has occured while restoring original configuration") + "\n\n%s"% e,
                 parent = self._parent)

File modules/support/vectorlinux/LOGINMANAGERS.py

             if line.startswith("DISPLAY_MANAGER="):
                 return line.replace("DISPLAY_MANAGER=","").strip()
         return None
+    
+    def _line_sets_manager(self, line):
+        """ Return true if line sets the login manager """
+        return line.startswith("DISPLAY_MANAGER=")
 
     def set_manager(self, manager=None):
-        """ Set the login manager to the value provided in manager """
-        if manager is None:
-            return False
+        """ Set the login manager to the value provided in manager 
+        Will raise an exception if we cannot write to the file."""
+        assert manager is not None, "Invalid login manager specified"
         f = open(self.specfile, "r")
         data = f.readlines()
         f.close()
         newdata = []
+        
         for line in data:
-            if line.startswith("DISPLAY_MANAGER="):
+            if self._line_sets_manager(line):
                 line = "DISPLAY_MANAGER=%s\n"% manager.upper()
             newdata.append(line)
-        try:
-            f = open(self.specfile, "w")
-            f.writelines(newdata)
-            f.close()
-            log.debug("System login manager has been set to %s"% manager)
-            # if everything was OK, the following test will return True
-            return self.get_current() == manager.upper()
-        except:
-            msg = ("Unable to set %s as the system login manager.",
-                " ", "Please check the contents and permissions of %s"% self.specfile)
-            log.fatal(" ".join(msg))
-            return False        
+        # Write the changes to the system.
+        f = open(self.specfile, 'w')
+        f.writelines(newdata)
+        f.close()
+        return
 

File modules/support/vectorlinux/REPOS.py

             
         # save a copy of the old file
         shutil.copy(self.filepath, "%s.bak"%self.filepath)
-        # Write to the disk
-        try:
-            f = open(self.filepath, "w")
-            f.writelines("".join(newdata))
-            f.close()
-            log.debug("%s has been modified."% self.filepath)
-            # notify observers.
-            self.notify()
-        except:
-            msg = "Unable to save changse to %s"% self.filepath
-            log.error(msg)
-            return True
-        return False
+        # Write to the disk, DO NOT catch this exception
+        f = open(self.filepath, 'w')
+        f.writelines(''.join(newdata))
+        f.close()
     
     def get_current_active_repos(self):
         """ Returns the list of currently active repos """

File modules/support/vectorlinux/SKEL.py

     def __init__(self, login="", skeldir='/etc/skel'):
         assert login not in ("", None), "You must provide a valid login name"
         self.login = login
-	self.skeldir = skeldir
+        self.skeldir = skeldir
         if login == 'root':
             self.targetdir = '/root'
         else:
             self.targetdir = os.path.join("/home", self.login)
 
     def _get_skel_description(self, skel=""):
-	DEF={
-		"Desktop":"Contents of your desktop.",
-		".Xdefaults":"X-Window and basic terminal settings.",
-		".Xmodmap":"GUI Keyboard mappings.",
-		".bash_profile":"Login startup procedures",
-		".bashrc":"Bash init procedures.",
-		".cache":"Personal data cache.",
-		".config":" Application personalization settings.",
-		".dbus": "Personal message bus settings.",
-		".dmrc": "Login manager preferences.",
-		".fluxbox": "Fluxbox window manager preferences.",
-		".gnome2": "Gnome 2.x preferences.",
-		".gtkrc-2.0.mine":"Personal GTK GUI themes and preferences.",
-		".gtkrc-2.0": "Default GTK GUI themes and preferences.",
-		".kde":"KDE Desktop preferences.",
-		".qt":"QT GUI settings (Affects KDE's and its application's appearance.)",
-		".asoundrc":"Audio settings",
-		".xinitrc":"X-Window initialization.",
-		"Shared Files": "Publicly shared files and folders",
-		".vimrc": "Personalization for vim.",
-		".jwmrc": "JWM window manager preferences.",
-		".mc": "Midnight Commander's preferences.",
-		"Downloads":"Downloaded data."		
-	}
-	if DEF.has_key(skel):
-	    return DEF[skel]
+        DEF={
+            "Desktop":"Contents of your desktop.",
+            ".Xdefaults":"X-Window and basic terminal settings.",
+            ".Xmodmap":"GUI Keyboard mappings.",
+            ".bash_profile":"Login startup procedures",
+            ".bashrc":"Bash init procedures.",
+            ".cache":"Personal data cache.",
+            ".config":" Application personalization settings.",
+            ".dbus": "Personal message bus settings.",
+            ".dmrc": "Login manager preferences.",
+            ".fluxbox": "Fluxbox window manager preferences.",
+            ".gnome2": "Gnome 2.x preferences.",
+            ".gtkrc-2.0.mine":"Personal GTK GUI themes and preferences.",
+            ".gtkrc-2.0": "Default GTK GUI themes and preferences.",
+            ".kde":"KDE Desktop preferences.",
+            ".qt":"QT GUI settings (Affects KDE's and its application's appearance.)",
+            ".asoundrc":"Audio settings",
+            ".xinitrc":"X-Window initialization.",
+            "Shared Files": "Publicly shared files and folders",
+            ".vimrc": "Personalization for vim.",
+            ".jwmrc": "JWM window manager preferences.",
+            ".mc": "Midnight Commander's preferences.",
+            "Downloads":"Downloaded data."		
+        }
+        if DEF.has_key(skel):
+            return DEF[skel]
         return skel
 
     def list_resettable_settings(self):
-	""" Return a list of resettable personalization files """
-	return os.listdir(self.skeldir)
+        """ Return a list of resettable personalization files """
+        return os.listdir(self.skeldir)
 
     def _wipe_setting(self, setting):
-	""" Reset <setting> back to factory default """
-	# Make sure the skel exists first
-	assert setting in os.listdir(self.skeldir), "Default value for %s not found "%setting
-	if " " in setting:
-	    setting = setting.replace(" ", "\ ")
-	source = os.path.join(self.skeldir, setting)
-	target = os.path.join(self.targetdir, setting)
-	# remove the old setting, then copy the new one
-	if os.path.isdir(target):
-	    shutil.rmtree(target)
-	    shutil.copytree(source, target)
-	else:
-	    os.remove(target)
-	    shutil.copyfile(source, target)
+        """ Reset <setting> back to factory default """
+        # Make sure the skel exists first
+        assert setting in os.listdir(self.skeldir), "Default value for %s not found "%setting
+        if " " in setting:
+            setting = setting.replace(" ", "\ ")
+        source = os.path.join(self.skeldir, setting)
+        target = os.path.join(self.targetdir, setting)
+        # remove the old setting, then copy the new one
+        if os.path.isdir(target):
+            shutil.rmtree(target)
+            shutil.copytree(source, target)
+        else:
+            os.remove(target)
+            shutil.copyfile(source, target)
 
     def _adjust_skel_permissions(self, skel):
         """ Adjust the permissions for skel"""
         return
 
     def reset_settings(self, reset_list=[]):
-	""" Reset the settings provided in reset_list. Returns True by default """
-	for item in reset_list:                
+        """ Reset the settings provided in reset_list. Returns True by default """
+        for item in reset_list:                
             self._wipe_setting(item)
             self._adjust_skel_permissions(item)
-	return True
+        return True

File modules/usermanage.py

 from support.vectorlinux import USERADMIN, PASSWORDS
 from support.vectorlinux.utils import _
 import gtk
+import logging
+
+logger = logging.getLogger('vasm')
 
 # vasm flags
 VASM_CATEGORY=_("System")
         self.passbox2.entry.set_text("")
         try:
             PASSWORDS.change_password(user, "foo", pass2)
+            logger.debug("Changed password for %s"%user)
         except PASSWORDS.UserModError as e:
+            logger.error("Failed to change password for %s.  %s"% (user, e))
             return dialogs.error(
             _("Unable to change the user password.") + "  \n\n" + e
                 )
         return dialogs.info(
             _("Password has been successfully changed for this user.")
             )
-        
+
     def apply_groups_event(self, widget):
         # Defines what happens when the apply button is pressed.
         # What happens depends on which page on the tabstrip we are currently on.
             self.user.groups = self.newgrouplist
             try:
                 self.user.save_groups_changes()
+                logger.debug("Saved group memberships for %s"% self.user.login)
             except AssertionError as e:
+                logger.error("Failed to save group memberships for %s.  %s"% (self.user.login, e))
                 return dialogs.error(
                     _("Unable to save changes.") + "  \n\n" + e
                     )
             except AccountError as e:
+                logger.error("Failed to save group memberships for %s.  %s"% (self.user.login, e))
                 msg = (_("You may be trying to save changes to a new account.")," ",
                 ("Make sure the account is created before trying to modify it."))
                 return dialogs.error(" ".join(msg))
             _("User group membership")), False, False, 2)
         self.body.pack_start(sw, True, True, 8)
         
-        
         self.set_position(gtk.WIN_POS_CENTER)
         self.ok_button.set_property('sensitive', False)
         # set the focus to the first entry
     
     def update_entered_login(self, widget):
         self.account.login = widget.get_text()
-        return self.ok_button.set_property('sensitive',
-            self.check_passwords())
+        self.toggle_ok_button(self.check_passwords())
     
     def update_entered_comment(self, widget):
         self.account.fullname = widget.get_text()
         if pass1 != pass2: return False
         return True
     
+    def toggle_ok_button(self, value):
+        """ Toggle the ok button to value """
+        return self.ok_button.set_property('sensitive', value)
+    
     def update_entered_password(self, widget):
         # check the passwords to see if they match before enabling the OK button
         if self.check_passwords():
-            #    self.passw = widget.get_text()
-            self.account.password = widget.get_text()
-            # check if the username is already entered
-        if not self.account.login:
-            return self.ok_button.set_property('sensitive', False)
-        self.account.password = None
-        return self.ok_button.set_property("sensitive", False)
+            if self.account.login:
+                self.account.password = widget.get_text()
+                self.toggle_ok_button(True)
+            else:
+                self.toggle_ok_button(False)
 
     def toggle_user_group(self, cell, path, model):
         """ Update the self.user_groups propety so that we can access it later
         if response == gtk.RESPONSE_YES:
             try:
                 self.usermodel.deleteUser(self.selected)
+                logger.debug("Deleted user account %s"% self.selected)
             except AssertionError as e:
+                logger.error("Failed to delete account for %s.  %s"% (self.selected, e))
                 return dialogs.error(
                 _("Unable to delete user.") + "\n\n" + e
                     )
             acct = box.account
             try:
                 self.usermodel.addUser(acct)
+                logger.info("Added user account %s"% acct.login)
             except AssertionError as e:
+                logger.error("Failed to add user %s.  %s"% (acct.login, e))
                 box.destroy()
                 return dialogs.error(
                 _("Unable to add new user account.") + " \n\n" + e)
             except USERADMIN.EmptyAttributeError as e:
+                logger.error("Failed to add user %s.  %s"% (acct.login, e))
                 box.destroy()
                 return dialogs.error(
                 _("Account information is incomplete.") + " \n\n" + e.message
         return True
 
 def main():
-    logger.info("Starting vasm GTK+2 UI as uid=%s"% os.geteuid())
     gtk.gdk.threads_init()
     gobject.threads_init()
     w = VASM()
 
     def keypress(self, size, key):
         if key in ('q', 'Q'):
+            logger.debug('Exit vasm urwid interface')
             raise urwid.ExitMainLoop
         return super(RightPane, self).keypress(size, key)
         
     return levels[level] or levels['4']
 
 def main():
-    # start the logging
-    logger.info("Starting vasm urwid interface as uid=%s"% os.geteuid())
     wbad = urwid.SolidFill()
     # Get the right palette
     if os.getenv("DISPLAY"):
 def start_logger():
     logger = logging.getLogger('vasm')
     hdlr = logging.handlers.SysLogHandler(address='/dev/log', facility='local0')
-    formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
+    #formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
+    formatter = logging.Formatter('%(levelname)s %(message)s')
     hdlr.setFormatter(formatter)
     logger.addHandler(hdlr)
     logger.setLevel(logging.ERROR)