Logging output to be redirected to a particular folder
__peter__ at web.de
Tue Nov 6 13:26:11 CET 2012
anuradha.raghupathy2010 at gmail.com wrote:
> Below is the python code that I have. I want to redirect the output to my
> C drive..myapp.log.
> I am editing and creating scripts in IDLE and running it as a python shell
> or module.
> Can you help?
> import logging
> def main():
> logging.basicConfig(Filename='c://myapp.log', level=logging.ERROR)
Python is case-sensitive. Try:
> logging.debug('started debug')
> logging.info('info printing')
> logging.warning('test warning')
> logging.debug('debug again')
> if __name__ == '__main__':
More information about the Python-list