Skip to content

Commit 49ab49e

Browse files
committed
Use logging instead of printing to STDOUT
1 parent 97eed7d commit 49ab49e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

normalize_repos/utils.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import os
2+
import logging
23

34
# Third party
45
from github import Github
56

7+
# Local
8+
import log
9+
10+
logger = logging.getLogger("normalize_repos")
11+
log.reset_handler()
612

713
GITHUB_ORGANIZATION = "creativecommons"
814
GITHUB_USERNAME = "cc-creativecommons-github-io-bot"
@@ -25,12 +31,14 @@
2531

2632

2733
def set_up_github_client():
28-
print("Setting up GitHub client...")
34+
logger.log(logging.INFO, "Setting up GitHub client...")
2935
github_client = Github(GITHUB_TOKEN)
36+
logger.log(log.SUCCESS, "done.")
3037
return github_client
3138

3239

3340
def get_cc_organization(github_client):
34-
print("Getting CC's GitHub organization...")
41+
logger.log(logging.INFO, "Getting CC's GitHub organization...")
3542
cc = github_client.get_organization(GITHUB_ORGANIZATION)
43+
logger.log(log.SUCCESS, "done.")
3644
return cc

0 commit comments

Comments
 (0)