Ignore:
Timestamp:
25 Jun 2011, 08:44:21 (13 years ago)
Author:
Henrik Bettermann
Message:

Save detailed logging messages (experimental).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/root.py

    r6444 r6475  
    3030from waeup.sirp.utils.logger import ISiteLoggers
    3131from waeup.sirp.applicants.interfaces import IApplicantsRoot
     32from waeup.sirp.utils.helpers import get_current_principal
    3233
    3334class ApplicantsRoot(grok.Container):
     
    4748            loggers.register('waeup.sirp.%s.applicants')
    4849        return loggers.getLogger('waeup.sirp.%s.applicants')
     50
     51    def logger_info(self, target, ob_class, comment=None):
     52        """Get the logger's info method.
     53        """
     54        user = get_current_principal()
     55        if user is None:
     56            user = 'system'
     57        elif user.title == 'Applicant':
     58            user = 'applicant'
     59        else:
     60            user = user.id
     61        self.logger.info('%s - %s - %s  - %s' % (user, target, ob_class, comment))
    4962
    5063class ApplicantsPlugin(grok.GlobalUtility):
Note: See TracChangeset for help on using the changeset viewer.