File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55from datetime import datetime , timedelta
66from dateutil .relativedelta import relativedelta
77import calendar
8+ from logger import Logger
89
910from __init__ import __version__ , __status__ , __website__
1011
1112""" Write Birthdays to an ICS file """
1213class 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 )} ' )
You can’t perform that action at this time.
0 commit comments