I have been trying to make a logging program to assist with debugging other projects that I have. However for some reason I get a error when I run this code:
import logging
logging.basicConfig(filename='logfile.txt', level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
data_to_log = "This is an example log message."
console.log(data_to_log)
>Solution :
I believe that you are confusing python and Javascript. instead of usingconsole.log() which is Javascript, use logging.info(data_to_log)