Changeset 419 for trunk/email2trac.py.in


Ignore:
Timestamp:
07/21/10 10:38:30 (12 years ago)
Author:
bas
Message:

Adde project name to logging format

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r416 r419  
    21162116########## Setup Logging ###############################################################
    21172117
    2118 def setup_log(parameters, interactive=None):
     2118def setup_log(parameters, project_name, interactive=None):
    21192119        """
    21202120        Setup loging
     
    21242124
    21252125        """
    2126         logger = logging.getLogger('email2trac')
     2126        logger = logging.getLogger('email2trac %s' %project_name)
    21272127
    21282128        if interactive:
     
    21592159                parameters.log_format = parameters.log_format.replace('$(', '%(')
    21602160        else:
    2161                 parameters.log_format = 'Email2trac: %(message)s'
     2161                parameters.log_format = '%(name)s: %(message)s'
    21622162
    21632163        log_formatter = logging.Formatter(parameters.log_format)
     
    22382238                settings.debug = debug_interactive
    22392239
    2240         logger = setup_log(settings, debug_interactive)
    2241 
    2242         if not settings.has_key('project'):
     2240
     2241        if not settings.project:
    22432242                print __doc__
    22442243                print 'No Trac project is defined in the email2trac config file.'
    22452244                sys.exit(1)
     2245
     2246        logger = setup_log(settings, os.path.basename(settings.project), debug_interactive)
    22462247       
    22472248        if component:
Note: See TracChangeset for help on using the changeset viewer.