Skip to content

Commit a1b7210

Browse files
Niloth-ptimabbott
authored andcommitted
google-calendar: Stop printing events unless the verbose option is set.
Currently, the integration prints all reminders to the terminal. Set logging level to info when --verbose is set, and switched `print` to `logging.info`, to restrict that output to only when the --verbose option is set.
1 parent db068a0 commit a1b7210

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

zulip/integrations/google/google-calendar

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ except ImportError:
7474

7575
if not options.zulip_email:
7676
parser.error("You must specify --user")
77+
if options.verbose:
78+
logging.getLogger().setLevel(logging.INFO)
7779

7880

7981
def get_credentials() -> Credentials:
@@ -159,7 +161,7 @@ def send_reminders() -> Optional[None]:
159161
line = f"{summary} is today."
160162
else:
161163
line = "{} starts at {}".format(summary, start.strftime("%H:%M"))
162-
print("Sending reminder:", line)
164+
logging.info("Sending reminder: %s", line)
163165
messages.append(line)
164166
keys.add(key)
165167

0 commit comments

Comments
 (0)