Le mardi 29 septembre 2020 à 16:33:39 UTC+2, Barry Scott a écrit :
> > On 29 Sep 2020, at 15:11, Alexandre FOURNEL <alexandr...@sia-partners.com> 
> > wrote: 
> > 
> > Hi all ! 
> > 
> > I'm trying to use logging lib in my python program. 
> > 
> > To try this lib, I am using basic code like : 
> > 
> > "import logging 
> > logging.basicConfig(filename='pont.txt', filemode='w',format='%(asctime)s 
> > %(message)s', datefmt='%d/%m/%Y %H:%M:%S', level=logging.DEBUG)
> Do you want to over write the file each run? 
> That is what 'w' says you want. Maybe try 'a' - append?
> > logging.debug('This message should go to the log file') 
> > logging.info('So should this') 
> > logging.warning('And this, too')" 
> > 
> > But between 2 execution, I have to open a new terminal to get new data in 
> > my file pont.txt. Do you know why ?
> Each time you run it the time stamps change right? 
> 
> Barry 
> 
> 
> > 
> > Thanks 
> > 
> > Alexandre 
> > -- 
> > https://mail.python.org/mailman/listinfo/python-list 
> >

If I use also "a" instead of "w", it doesn't work ...
It works only when I use a new terminal (I am using Spyder to code)
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to