logfile = 'logs' + os.sep + ((__file__.upper())[(__file__.rfind(os.sep)+1):]).replace('.PY', '.log') logging.basicConfig(format= '%(asctime)-12s [%(filename)-10s] %(levelname)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S', filename=logfile, filemode='w', level=logging.INFO)
will create a log file in the project workspace on which you can work
source share