/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2012-05-01 20:33:23 UTC
  • Revision ID: teddy@recompile.se-20120501203323-l9biqff88d41cllz
* mandos (AvahiService.rename, Client.start_checker,
          DBusObjectWithProperties.Introspect, main): Use new
          "exc_info" keyword argument to logger to log exception
          information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
277
277
        try:
278
278
            self.add()
279
279
        except dbus.exceptions.DBusException as error:
280
 
            logger.critical("DBusException: %s", error)
 
280
            logger.critical("D-Bus Exception", exc_info=error)
281
281
            self.cleanup()
282
282
            os._exit(1)
283
283
        self.rename_count += 1
693
693
                try:
694
694
                    command = self.checker_command % escaped_attrs
695
695
                except TypeError as error:
696
 
                    logger.error('Could not format string "%s":'
697
 
                                 ' %s', self.checker_command, error)
 
696
                    logger.error('Could not format string "%s"',
 
697
                                 self.checker_command, exc_info=error)
698
698
                    return True # Try again later
699
699
            self.current_checker_command = command
700
700
            try:
718
718
                    gobject.source_remove(self.checker_callback_tag)
719
719
                    self.checker_callback(pid, status, command)
720
720
            except OSError as error:
721
 
                logger.error("Failed to start subprocess: %s",
722
 
                             error)
 
721
                logger.error("Failed to start subprocess",
 
722
                             exc_info=error)
723
723
        # Re-run this periodically if run by gobject.timeout_add
724
724
        return True
725
725
    
1006
1006
        except (AttributeError, xml.dom.DOMException,
1007
1007
                xml.parsers.expat.ExpatError) as error:
1008
1008
            logger.error("Failed to override Introspection method",
1009
 
                         error)
 
1009
                         exc_info=error)
1010
1010
        return xmlstring
1011
1011
 
1012
1012
 
2616
2616
        try:
2617
2617
            service.activate()
2618
2618
        except dbus.exceptions.DBusException as error:
2619
 
            logger.critical("DBusException: %s", error)
 
2619
            logger.critical("D-Bus Exception", exc_info=error)
2620
2620
            cleanup()
2621
2621
            sys.exit(1)
2622
2622
        # End of Avahi example code
2629
2629
        logger.debug("Starting main loop")
2630
2630
        main_loop.run()
2631
2631
    except AvahiError as error:
2632
 
        logger.critical("AvahiError: %s", error)
 
2632
        logger.critical("Avahi Error", exc_info=error)
2633
2633
        cleanup()
2634
2634
        sys.exit(1)
2635
2635
    except KeyboardInterrupt: