Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81196 > unrolled thread
| Started by | "Stéphane Wirtel" <stephane@wirtel.be> |
|---|---|
| First post | 2014-11-21 11:57 +0100 |
| Last post | 2014-11-21 11:57 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Python Logging and printf() "Stéphane Wirtel" <stephane@wirtel.be> - 2014-11-21 11:57 +0100
| From | "Stéphane Wirtel" <stephane@wirtel.be> |
|---|---|
| Date | 2014-11-21 11:57 +0100 |
| Subject | Re: Python Logging and printf() |
| Message-ID | <mailman.16096.1416567946.18130.python-list@python.org> |
On 21 Nov 2014, at 11:48, Ganesh Pal wrote: > Hi Team , > > Iam using the python logging module to log the events for my > application > into a log file . > > I have set the logging level to DEBUG as shown below > > logging.basicConfig(filename=options.log_file, > level=logging.DEBUG, > format='%(asctime)s %(levelname)s:%(message)s', > datefmt='%m/%d/%Y %I:%M:%S %p') > > iam also using logging.warning(),logging.error(),logging.info() etc > as > and when required. > > Please provide your input on the below questions. > > (1). How do i guarantee that all console messages will be logged into > the > logfile ? There is no guarantee, it's a software. But all the log messages have to be stored in the logfile > (2) I feel the need to retain few print(), how do I ensure the > print() > messages are also logged into the log file. the print function or print keyword don't use the logging module, you need to use it. > > > > Regards, > Ganesh > -- > https://mail.python.org/mailman/listinfo/python-list -- Stéphane Wirtel - http://wirtel.be - @matrixise
Back to top | Article view | comp.lang.python
csiph-web