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


Groups > comp.lang.python > #62266

Re: Logger module in python

Subject Re: Logger module in python
From Paul Smith <paul@mad-scientist.net>
Date 2013-12-17 22:46 -0500
References <fabe3b07-3d2f-48f2-9e56-2fdebff39175@googlegroups.com> <l8r4mn$teh$1@ger.gmane.org>
Organization GNU's Not UNIX!
Newsgroups comp.lang.python
Message-ID <mailman.4329.1387338793.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, 2013-12-18 at 03:27 +0000, Mark Lawrence wrote:
> On 18/12/2013 03:22, smilesonisamal@gmail.com wrote:
> > Hi,
> > I am a newbie in python. I am looking for a existing module which I
> can import in my program to log the objects to a file?
> >
> > I know there is a module Data::Dumper in perl which dumps the
> objects to file. But not sure about python.
> 
> http://docs.python.org/3/library/logging.html

That's not what the OP wants.

Pradeep, if you want to dump data for debugging take a look at the
pprint module; for example:

http://docs.python.org/3.3/library/pprint.html

If you want to store Python objects in files and read them later, most
people seem to use pickle for that:

http://docs.python.org/3.3/library/pickle.html

Others translate into another format.

See this SO question for some other suggestions:

http://stackoverflow.com/questions/2540567/is-there-a-python-equivalent-to-perls-datadumper

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


Thread

Logger module in python smilesonisamal@gmail.com - 2013-12-17 19:22 -0800
  Re: Logger module in python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-18 03:27 +0000
  Re: Logger module in python Paul Smith <paul@mad-scientist.net> - 2013-12-17 22:46 -0500
  Re: Logger module in python Roy Smith <roy@panix.com> - 2013-12-17 22:54 -0500
  Re: Logger module in python rusi <rustompmody@gmail.com> - 2013-12-17 20:32 -0800

csiph-web