log file

adam.preble at gmail.com adam.preble at gmail.com
Thu Mar 21 23:39:05 EDT 2019


On Thursday, March 21, 2019 at 10:26:14 PM UTC-5, Sharan Basappa wrote:
> I am running a program and even though the program runs all fine, the log file is missing. I have pasted first few lines of the code.
> 
I am thinking--hoping, rather--that you just kind of double pasted there. Anyways, you needed to specify the logging level in basicConfig:

import os
import csv
import logging
import random

#Create and configure logger
# Check out level=logging.INFO
logging.basicConfig(filename="test_1.log", filemode='w', format='%(asctime)s %(message)s', level=logging.INFO)
log = logging.getLogger()
log.info("Yay!")



More information about the Python-list mailing list