Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Logging output to be redirected to a particular folder
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
anuradha.raghupathy2...@gmail.com  
View profile  
 More options Nov 6 2012, 6:28 am
Newsgroups: comp.lang.python
From: anuradha.raghupathy2...@gmail.com
Date: Tue, 6 Nov 2012 03:28:05 -0800 (PST)
Local: Tues, Nov 6 2012 6:28 am
Subject: Logging output to be redirected to a particular folder
Hi,

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)
   logging.debug('started debug')
   logging.info('info printing')
   logging.warning('test warning')
   logging.debug('debug again')
   logging.error('Error')

if __name__ == '__main__':
   main()


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Otten  
View profile  
 More options Nov 6 2012, 7:26 am
Newsgroups: comp.lang.python
From: Peter Otten <__pete...@web.de>
Date: Tue, 06 Nov 2012 13:26:11 +0100
Local: Tues, Nov 6 2012 7:26 am
Subject: Re: Logging output to be redirected to a particular folder

anuradha.raghupathy2...@gmail.com wrote:
> Hi,

> 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.basicConfig(filename='c://myapp.log', level=logging.ERROR)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Prasad, Ramit  
View profile  
 More options Nov 6 2012, 12:58 pm
Newsgroups: comp.lang.python
From: "Prasad, Ramit" <ramit.pra...@jpmorgan.com>
Date: Tue, 6 Nov 2012 17:58:21 +0000
Local: Tues, Nov 6 2012 12:58 pm
Subject: RE: Logging output to be redirected to a particular folder

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.  


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
anuradha.raghupathy2...@gmail.com  
View profile  
 More options Nov 7 2012, 1:39 am
Newsgroups: comp.lang.python
From: anuradha.raghupathy2...@gmail.com
Date: Tue, 6 Nov 2012 22:39:05 -0800 (PST)
Local: Wed, Nov 7 2012 1:39 am
Subject: Re: Logging output to be redirected to a particular folder
Thanks ...this works perfectly fine now.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
anuradha.raghupathy2...@gmail.com  
View profile  
 More options Nov 7 2012, 1:49 am
Newsgroups: comp.lang.python
From: anuradha.raghupathy2...@gmail.com
Date: Tue, 6 Nov 2012 22:39:05 -0800 (PST)
Local: Wed, Nov 7 2012 1:39 am
Subject: Re: Logging output to be redirected to a particular folder
Thanks ...this works perfectly fine now.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »