Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#1211 closed defect (fixed)

let the logger do the formatting

Reported by: sascha_silbe Owned by: tomeu
Priority: Unspecified by Maintainer Milestone:
Component: Sugar Version: Unspecified
Severity: Unspecified Keywords: r+
Cc: Distribution/OS: Unspecified
Bug Status: New

Description

With the attached patch we delegate the string formatting to the logger instead of doing it ourselves.
Advantages:
a) It's more robust: Constructs like 'debug("foo %r bar" % x)' are quite common in our code and will break if x is a tuple. 'debug("foo %r bar", x)' will work regardless of the type of x.
b) formatting only happens if we actually log something.

I haven't measured the impact of b) because a) is much more important to me (happened a lot of times during the object_id => (tree_id, version_id) conversion). At least one project has asked for pylint to flag these occurences and gave performance as a reason for the change, though (so they mave have measured it).

Attachments (1)

0001-let-the-logger-do-the-formatting.patch (14.2 KB) - added by sascha_silbe 12 years ago.
let the logger do the formatting

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by sascha_silbe

let the logger do the formatting

comment:1 Changed 12 years ago by erikos

  • Milestone changed from Unspecified by Release Team to 0.86

comment:2 Changed 12 years ago by tomeu

  • Keywords r+ added; r? removed
  • Resolution set to fixed
  • Status changed from new to closed

Pushed, thanks!

comment:3 Changed 8 years ago by dnarvaez

  • Component changed from sugar-datastore to Sugar

comment:4 Changed 8 years ago by dnarvaez

  • Milestone 0.86 deleted

Milestone 0.86 deleted

Note: See TracTickets for help on using tickets.