~mgedmin/apport/fix-lp1453011

« back to all changes in this revision

Viewing changes to data/general-hooks/generic.py

  • Committer: Martin Pitt
  • Date: 2015-03-27 18:01:16 UTC
  • Revision ID: martin.pitt@canonical.com-20150327180116-aikkjbbkmndcvvz8
* general-hooks/generic.py: Add systemd journal warnings and errors to the new "JournalErrors" field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
            and report['ProblemType'] == 'Package':
87
87
        report['UnreportableReason'] = 'The package installation resulted in a segmentation fault which is better reported as a crash report rather than a package install failure.'
88
88
 
 
89
    # log warnings/errors
 
90
    if os.path.exists('/run/systemd/system'):
 
91
        report['JournalErrors'] = apport.hookutils.command_output(
 
92
            ['journalctl', '-b', '--priority', 'warning'])
89
93
 
90
94
if __name__ == '__main__':
91
95
    r = {}