-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor print statements to use logger (#3330)
- Loading branch information
1 parent
294286a
commit 8936218
Showing
31 changed files
with
305 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
# You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
from collections import Counter | ||
from logging import INFO, basicConfig, getLogger | ||
|
||
import xgboost | ||
from sklearn.compose import ColumnTransformer | ||
|
@@ -24,6 +25,9 @@ | |
"[email protected]", | ||
] | ||
|
||
basicConfig(level=INFO) | ||
logger = getLogger(__name__) | ||
|
||
|
||
class AssigneeModel(BugModel): | ||
def __init__(self, lemmatization=False): | ||
|
@@ -100,9 +104,9 @@ def get_labels(self): | |
if count > MINIMUM_ASSIGNMENTS | ||
) | ||
|
||
print(f"{len(top_assignees)} assignees") | ||
logger.info("%d assignees", len(top_assignees)) | ||
for assignee, count in assignee_counts: | ||
print(f"{assignee}: {count}") | ||
logger.info("%s: %d", assignee, count) | ||
|
||
classes = { | ||
bug_id: assignee | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.