Ignore:
Timestamp:
18 Nov 2012, 14:25:35 (12 years ago)
Author:
Henrik Bettermann
Message:

Log job_id. Now we can retrieve the information from the log file, who has created the report, who has downloaded the report and who has discarded the report.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/reports.py

    r9677 r9679  
    4949            self.flash('Report discarded: %s' % job_id)
    5050            ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
    51             grok.getSite().logger.info('%s - discarded: %s' % (ob_class, job_id))
     51            grok.getSite().logger.info(
     52                '%s - report %s discarded' % (ob_class, job_id))
    5253        self.entries = self._generate_entries(user_id=None)
    5354        if job_id and DOWNLOAD:
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports.py

    r9678 r9679  
    189189                mode=mode)
    190190            self.flash(_('New report is being created in background'))
    191             container.start_report_job(
     191            job_id = container.start_report_job(
    192192                self.generator_name, user_id, kw=kw)
    193193            ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
    194194            grok.getSite().logger.info(
    195                 '%s - created: %s (session=%s, mode=%s)' % (
    196                 ob_class, self.context.title, session, mode))
     195                '%s - report %s created: %s (session=%s, mode=%s)' % (
     196                ob_class, job_id, self.context.title, session, mode))
    197197            self.redirect(self.parent_url)
    198198            return
     
    227227        pdf_stream = self.context.create_pdf()
    228228        ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
    229         grok.getSite().logger.info('%s - downloaded: %s' % (ob_class, filename))
     229        grok.getSite().logger.info('%s - report %s downloaded: %s' % (
     230            ob_class, self.context.__name__, filename))
    230231        return pdf_stream
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_reports.py

    r9678 r9679  
    129129        self.assertTrue(
    130130            'INFO - zope.mgr - students.reports.StudentsReportGeneratorPage - '
    131             'created: Students (session=2004, mode=All)' in logcontent
     131            'report %s created: Students (session=2004, mode=All)'
     132            % job_id in logcontent
    132133            )
    133134        self.assertTrue(
    134135            'INFO - zope.mgr - students.reports.StudentsReportPDFView - '
    135             'downloaded: StudentsReport_2004_2005_All_' in logcontent
     136            'report %s downloaded: StudentsReport_2004_2005_All_'
     137            % job_id in logcontent
    136138            )
    137139        self.assertTrue(
    138140            'INFO - zope.mgr - browser.reports.ReportsContainerPage - '
    139             'discarded: %s' % job_id in logcontent
     141            'report %s discarded' % job_id in logcontent
    140142            )
    141143        return
Note: See TracChangeset for help on using the changeset viewer.