Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32837

RE: Logging output to be redirected to a particular folder

From "Prasad, Ramit" <ramit.prasad@jpmorgan.com>
Subject RE: Logging output to be redirected to a particular folder
Date 2012-11-06 17:58 +0000
References <bdec816f-bde8-427a-b604-30e12a773595@googlegroups.com> <k7avku$ecv$1@ger.gmane.org> <ueii98t9ivukh3v2ojc89795g94j9n68oh@invalid.netcom.com>
Newsgroups comp.lang.python
Message-ID <mailman.3335.1352224715.27098.python-list@python.org> (permalink)

Show all headers | View raw


Dennis Lee Bieber wrote:
> 
> On Tue, 06 Nov 2012 13:26:11 +0100, Peter Otten <__peter__@web.de>
> declaimed the following in gmane.comp.python.general:
> 
> > anuradha.raghupathy2010@gmail.com wrote:
[snip]
> > > def main():
> > >    logging.basicConfig(Filename='c://myapp.log', level=logging.ERROR)
> >
> > Python is case-sensitive. Try:
> >
> >      logging.basicConfig(filename='c://myapp.log', level=logging.ERROR)
> >
> 	The double forward slashes might also be confusing... At the least,
> unneeded...
> 
> >>> import os.path
> >>> print os.path.normpath("c://somefile.log")
> c:\somefile.log
> >>> print os.path.normpath("c:\\somefile.log")
> c:\somefile.log
> >>> print os.path.normpath("c:\\tryfile.log")
> c:\tryfile.log
> >>> print os.path.normpath("c:\tryfile.log")
> c:	ryfile.log
> >>> print os.path.normpath("c:/tryfile.log")
> c:\tryfile.log
> >>>
> 
> 	Doubling back-slashes is needed to avoid the problem of literal
> escapes corrupting the intent...

Or use the raw literal form r"c:\tryfile.log". I know several
people that prefer to use forward slashes as it works in both 
Windows and *nix.


~Ramit


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Logging output to be redirected to a particular folder anuradha.raghupathy2010@gmail.com - 2012-11-06 03:28 -0800
  Re: Logging output to be redirected to a particular folder Peter Otten <__peter__@web.de> - 2012-11-06 13:26 +0100
  Re: Logging output to be redirected to a particular folder Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-11-06 12:38 -0500
  RE: Logging output to be redirected to a particular folder "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-06 17:58 +0000
    Re: Logging output to be redirected to a particular folder anuradha.raghupathy2010@gmail.com - 2012-11-06 22:39 -0800
    Re: Logging output to be redirected to a particular folder anuradha.raghupathy2010@gmail.com - 2012-11-06 22:39 -0800

csiph-web