Re: Logging to file and not to console

2013-10-27 Thread Johannes Findeisen
On Sun, 27 Oct 2013 11:09:08 +0100 Peter Otten wrote: > Johannes Findeisen wrote: > > > Hi all, > > > > I am going crazy with logging. I have an application which sets up > > logging after parsing the args in the main() funktion. It needs to be > > setup after parsing the args because I can set

Re: Logging to file and not to console

2013-10-27 Thread Johannes Findeisen
On Sun, 27 Oct 2013 11:09:08 +0100 Peter Otten wrote: > Johannes Findeisen wrote: > > > Hi all, > > > > I am going crazy with logging. I have an application which sets up > > logging after parsing the args in the main() funktion. It needs to be > > setup after parsing the args because I can set

Re: Logging to file and not to console

2013-10-27 Thread Peter Otten
Peter Otten wrote: > def levelnames(): > try: > names = logging._nameToLevel > except AttributeError: > names = (name for name in logging._levelNames if isinstance(name, > str)) Trainwreck alert :( I recommend that you use the following list "DEBUG INFO WARN ERROR CRITIC

Re: Logging to file and not to console

2013-10-27 Thread Peter Otten
Johannes Findeisen wrote: > Hi all, > > I am going crazy with logging. I have an application which sets up > logging after parsing the args in the main() funktion. It needs to be > setup after parsing the args because I can set the loglevel via > commandline flags. > > I have tried many variants

Logging to file and not to console

2013-10-27 Thread Johannes Findeisen
Hi all, I am going crazy with logging. I have an application which sets up logging after parsing the args in the main() funktion. It needs to be setup after parsing the args because I can set the loglevel via commandline flags. I have tried many variants on how to do that but every time with an w