Closed Bug 671853 Opened 13 years ago Closed 13 years ago

use Python logging module in AUS3

Categories

(Release Engineering :: General, defect, P3)

x86_64
Linux
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bhearsum, Assigned: bhearsum)

References

Details

Attachments

(2 files)

      No description provided.
Priority: -- → P3
Assignee: nobody → bhearsum
Much of this patch is s/print/log.[something]/. I converted all of the commented out print statements from AUS.py to log.debug, which will be shown if AUS-server.py or test-rules.py are run in verbose mode. I converted dumpRules and dumpReleases to plain getters because I thought it felt like the actually printing of those belonged in test-rules.py. I can revert that if you prefer, though.
Attachment #547195 - Flags: review?(nrthomas)
Comment on attachment 547195 [details] [diff] [review]
use python logging in AUS3 + test runner

Is nice! A few nits to fix on landing:

>-            #print row, updateQuery['name']
>+            log.debug("AUS.getMatchingRules: %s %s", row, updateQuery['name'])

Need to do self.convertRule(row) so we get something useful printed; can drop the updateQuery part. This looks like ancient code of mine.

>     def evaluateRules(self, updateQuery):
...
>+        log.debug("AUS.evaluateRules: Matching rules:")
>+        for r in rules:
>+            log.debug("AUS.evaluateRules: %s", r)

Not worth writing out the rules here and in getMatchingRules, so I'd suggest pulling this one.

>         if not res:
>             # need to log some sort of data inconsistency error here
>-            # print "AUS.expandRelease failed to get release data from db"
>+            log.debug("AUS.expandRelease: Failed to get release data from db for:")
>+            log.debug("AUS.expandRelease: %s", updateQuery)

I think I meant to write rule['mapping'] instead of updateQuery there.

>diff --git a/test-rules.py b/test-rules.py
>-                print "FAIL: %s" % f
>+                log.info("FAIL: ", f)

Need to add back in the %s's in this file.
Attachment #547195 - Flags: review?(nrthomas) → review+
Since I want to re-organise the code I went ahead and made those changes, and fixed the rot from the alias bug.

http://hg.mozilla.org/users/nthomas_mozilla.com/aus3-proto/rev/3602a2f4a621

FIXED ?
Attachment #547318 - Flags: review+
Attachment #547318 - Flags: checked-in+
(In reply to comment #3)
> Created attachment 547318 [details] [diff] [review] [review]
> use python logging in AUS3 + test runner, v1.1
> 
> Since I want to re-organise the code I went ahead and made those changes,
> and fixed the rot from the alias bug.
> 
> http://hg.mozilla.org/users/nthomas_mozilla.com/aus3-proto/rev/3602a2f4a621
> 
> FIXED ?
(In reply to comment #4)
> Missed one of my comments, fixed in
>   http://hg.mozilla.org/users/nthomas_mozilla.com/aus3-proto/rev/046f84413300

Looks good to me.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: