I can't seem to get it right - I can't even make sense of the standard
library docs. What do I have to do to log records to a file?
(Newbie Q, as you might guess...)
-Kamus
--
o__ | If you're old, eat right and ride a decent bike.
,>/'_ | Q.
(_)\(_) | Usenet posting`
logFacility = logging.getLogger( "MyApp" )
logFile = logging.FileHandler( "LogFile.log" )
logFormat = logging.Formatter( '%(asctime)s %(levelname)s
%(message)s' )
logFile.setFormatter( logFormat )
logFacility.addHandler( logFile )
logFacility.setLevel( logging.WARNING )
logFacility.info( "Starting Up" )
**
HTH
John
Did you look in the logging documentation? At the end of the
current docs, there's a simple example:
http://www.python.org/dev/doc/devel/lib/node302.html
--
Anthony Baxter <ant...@interlink.com.au>
It's never too late to have a happy childhood.
> Did you look in the logging documentation? At the end of the
> current docs, there's a simple example:
Missed that.
Is there a search on python.org that only searches docs? That would be
really helpful.... I keep coming up with gobs of irrelevant stuff on my
searches.
I keep missing simple stuff like that.
-Kamus
> Is there a search on python.org that only searches docs? That would be
> really helpful.... I keep coming up with gobs of irrelevant stuff on my
> searches.
>
> I keep missing simple stuff like that.
Not really a search engine, but the index of the documentation can be
very useful. Also very useful is simply browsing the documentation
without looking for something specific, just to get the feeling what it
is there is.
Gerrit.
--
49. If any one take money from a merchant, and give the merchant a
field tillable for corn or sesame and order him to plant corn or sesame in
the field, and to harvest the crop; if the cultivator plant corn or sesame
in the field, at the harvest the corn or sesame that is in the field shall
belong to the owner of the field and he shall pay corn as rent, for the
money he received from the merchant, and the livelihood of the cultivator
shall he give to the merchant.
-- 1780 BC, Hammurabi, Code of Law
--
Asperger's Syndrome - a personal approach:
http://people.nl.linux.org/~gerrit/english/
http://python.org/doc/2.3/modindex.html
cheers,
pieter
Creo
pieter claerhout | product support prinergy | tel: +32 2 352 2511 |
pieter.c...@creo.com | www.creo.com
IMAGINE CREATE BELIEVE(tm)
-----Original Message-----
From: Pieter Claerhout [mailto:Pieter.C...@creo.com]
Sent: 18 December 2003 14:43
To: 'Kamus of Kadizhar'; pytho...@python.org
Subject: RE: Searching docs (was Re: Logging)
You can search through the docs on:
http://web.pydoc.org/
and on
http://starship.python.net/crew/theller/pyhelp.cgi
cheers,
pieter
Creo
pieter claerhout | product support prinergy | tel: +32 2 352 2511 |
pieter.c...@creo.com | www.creo.com
IMAGINE CREATE BELIEVE(tm)
-----Original Message-----
From: Kamus of Kadizhar [mailto:y...@NsOeSiPnAeMr.com]
Sent: 18 December 2003 14:20
To: pytho...@python.org
Subject: Searching docs (was Re: Logging)
On Thu, 18 Dec 2003 23:40:33 +1100, Anthony Baxter wrote:
> Did you look in the logging documentation? At the end of the
> current docs, there's a simple example:
Missed that.
Is there a search on python.org that only searches docs? That would be
really helpful.... I keep coming up with gobs of irrelevant stuff on my
searches.
I keep missing simple stuff like that.
-Kamus
--
http://mail.python.org/mailman/listinfo/python-list
You can also torque up pydoc as a local http server by starting it with
the command line
python pydoc.py -p <port#>
...then point your browser to http://localhost:<port#>
Running pydoc locally has the advantage that it also lets you poke
through all the python modules and packages that are on your system. It
has the other advantage that it encourages you (well, me, anyway) to
write better docstrings...
The disadvantage is that it doesn't offer a search facility. Perhaps
some combination of pydoc and LuPy wouldn't be too hard to make happen...
Kamus> Missed that.
Kamus> Is there a search on python.org that only searches docs? That
Kamus> would be really helpful.... I keep coming up with gobs of
Kamus> irrelevant stuff on my searches.
I've been meaning to put together some Google tips for python.org. Your
plea goaded me into action. The beginnings are here:
http://www.python.org/cgi-bin/moinmoin/GoogleTips
Many more are possible based upon the many mailing lists and documents the
site contains. Feel free to add to what's there.
Skip