Using python, I am unable to get my log file to save.
import logging
from datetime import datetime
#Open a log file to save diagnostic data
TODAY = datetime.now() #get current date and time
DAY = TODAY.strftime("%d") #format day as string
MONTH = TODAY.strftime("%m") #format month as string
YEAR = TODAY.strftime("%y") #format year as string
HOUR = TODAY.strftime("%H") #format hour as string
MINUTE = TODAY.strftime("%M") #format minute as string
LOG_FILE = MONTH + "-" + DAY + "-" + YEAR + "-H" + HOUR + "-M" + MINUTE + ".log"
logging.basicConfig(filename=LOG_FILE, level=logging.DEBUG)
logging.debug('Test message')
Not sure what I'm doing wrong
edit: No debug message is printed to the console. Basically this script currently does nothing.
update: Looks like the script runs fine on my raspberry pi, but not on my macbook. Perhaps it is an issue with default handlers?