I have a little problem, I use logging library and when script running none of log dose not write into a file. After program finished all logs suddenly appear in file. How to put logs in file in realtime? Sorry for my english.
This is my example code:
import logging, time
logging.basicConfig(filename='C:/testlog.log', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
logging.debug('This is a log message.')
x = 1
while x < 6:
time.sleep(1)
logging.error('Log test: ' + str(x))
x=x+1