Skip to content

Commit de0de0d

Browse files
authored
Uncomment and fix logger lines in ics writer (#80)
1 parent 5f6e313 commit de0de0d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/ics_writer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
from datetime import datetime, timedelta
66
from dateutil.relativedelta import relativedelta
77
import calendar
8+
from logger import Logger
89

910
from __init__ import __version__, __status__, __website__
1011

1112
""" Write Birthdays to an ICS file """
1213
class ICSWriter:
1314

1415
def __init__(self, birthdays):
16+
self.logger = Logger('fb2cal').getLogger()
1517
self.birthdays = birthdays
1618

1719
def generate(self):
@@ -54,13 +56,13 @@ def generate(self):
5456
def write(self, ics_file_path):
5557
# Remove blank lines
5658
ics_str = ''.join([line.rstrip('\n') for line in self.birthday_calendar])
57-
# logger.debug(f'ics_str: {ics_str}')
59+
self.logger.debug(f'ics_str: {ics_str}')
5860

59-
# logger.info(f'Saving ICS file to local file system...')
61+
self.logger.info(f'Saving ICS file to local file system...')
6062

6163
if not os.path.exists(os.path.dirname(ics_file_path)):
6264
os.makedirs(os.path.dirname(ics_file_path), exist_ok=True)
6365

6466
with open(ics_file_path, mode='w', encoding="UTF-8") as ics_file:
6567
ics_file.write(ics_str)
66-
#logger.info(f'Successfully saved ICS file to {os.path.abspath(ics_file_path)}')
68+
self.logger.info(f'Successfully saved ICS file to {os.path.abspath(ics_file_path)}')

0 commit comments

Comments
 (0)