Modify ↓
Opened 8 years ago
Closed 8 years ago
#13103 closed defect (fixed)
Should pass as parameter rather than string interpolation for logging api
Reported by: | Jun Omae | Owned by: | Eli Carter |
---|---|---|---|
Priority: | normal | Component: | AdvancedTicketWorkflowPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
For logging api, this plugin use string interpolation. I think we should pass as parameter like this:
-
advancedworkflow/controller.py
diff --git a/advancedworkflow/controller.py b/advancedworkflow/controller.py index d8cac545b..766309105 100644
a b class TicketWorkflowOpOwnerComponent(TicketWorkflowOpBase): 127 127 def _new_owner(self, ticket): 128 128 """Determines the new owner""" 129 129 component = model.Component(self.env, name=ticket['component']) 130 self. env.log.debug("component %s, owner %s" % (component, component.owner))130 self.log.debug("component %s, owner %s", component, component.owner) 131 131 return component.owner 132 132 133 133 … … class TicketWorkflowOpRunExternal(TicketWorkflowOpBase): 318 318 script += extension 319 319 break 320 320 else: 321 self.env.log.error("Error in ticket workflow config; could not find external command to run for %s in %s" % (action, os 321 self.log.error("Error in ticket workflow config; could not find " 322 "external command to run for %s in %s", 323 action, os.path.join(self.env.path, 'hooks')) 322 324 return 323 325 retval = call([script, str(ticket.id), req.authname]) 324 326 if retval: 325 self.env.log.error("External script %r exited with return code %s." % (script, retval)) 327 self.log.error("External script %r exited with return code %s.", 328 script, retval) 326 329 327 330 328 331 class TicketWorkflowOpTriage(TicketWorkflowOpBase): … … class TicketWorkflowOpTriage(TicketWorkflowOpBase): 371 374 if value == ticket[field].strip(): 372 375 break 373 376 else: 374 self.env.log.error("Bad configuration for 'triage' operation in action '%s'" % action) 377 self.log.error("Bad configuration for 'triage' operation in " 378 "action '%s'", action) 375 379 status = 'new' 376 380 return status 377 381 … … class TicketWorkflowOpXRef(TicketWorkflowOpBase): 467 471 tn.notify(xticket, newticket=False, modtime=now) 468 472 except Exception, e: 469 473 self.log.exception("Failure sending notification on change to " 470 "ticket #%s: %s" % (ticketnum, e))474 "ticket #%s: %s", ticketnum, e) 471 475 472 476 473 477 class TicketWorkflowOpResetMilestone(TicketWorkflowOpBase):
Attachments (0)
Note: See
TracTickets for help on using
tickets.
This was already fixed for the 1.2 branch in r14247. Feel free to commit changes to the other branches if you like.