Bug 35821 - python: Create a function for getting a module-specific logger
Summary: python: Create a function for getting a module-specific logger
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Chris Jerdonek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-05 17:02 PST by Chris Jerdonek
Modified: 2010-03-22 05:52 PDT (History)
5 users (show)

See Also:


Attachments
Proposed patch (10.28 KB, patch)
2010-03-06 22:43 PST, Chris Jerdonek
abarth: review+
cjerdonek: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jerdonek 2010-03-05 17:02:21 PST
We should create a function for getting a logging.logger with the fully-qualified name of a module.  That way we don't have to hard-code the fully-qualified module name in every module, like so--

_log = logging.getLogger("webkitpy.layout_tests.port.http_server_base")

The function can probably go in webkitpy/init (soon to be something like webkit/infra).  It will probably take something like __file__ as a parameter.

Eric originally suggested this idea here:

https://bugs.webkit.org/show_bug.cgi?id=35194#c11
Comment 1 Chris Jerdonek 2010-03-06 22:43:11 PST
Created attachment 50168 [details]
Proposed patch
Comment 2 Adam Barth 2010-03-13 02:17:10 PST
Comment on attachment 50168 [details]
Proposed patch

Straightforward.  I suppose the next step is to convert our existing call sites to the new hotness.
Comment 3 Chris Jerdonek 2010-03-22 05:52:19 PDT
(In reply to comment #2)
> (From update of attachment 50168 [details])
> Straightforward.  I suppose the next step is to convert our existing call sites
> to the new hotness.

Thanks again, Adam!  Yes, I think that would be the natural next step.
Comment 4 Chris Jerdonek 2010-03-22 05:52:52 PDT
Manually committed after rebasing (via "git svn dcommit"):

http://trac.webkit.org/changeset/56331