Aug-02-2020, 08:28 PM
Quote:I want to define csvfile (HATY.csv which is input file name) as my logfile name.I'm guessing you just want to use HATY as the file prefix, with timestamp unaltered, and don't want the logfile to
be named HAY.csv as stated.
so:
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)04d:%(levelname)s: %(message)s', filename=('HATY'+datetime.today().strftime('%Y%m%d_%H%M%S')+'.txt'), filemode='w',datefmt='%Y-%m-%d %H:%M:%S')