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


Groups > comp.lang.python > #81195 > unrolled thread

Python Logging and printf()

Started byGanesh Pal <ganesh1pal@gmail.com>
First post2014-11-21 16:18 +0530
Last post2014-11-21 16:18 +0530
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Python Logging and printf() Ganesh Pal <ganesh1pal@gmail.com> - 2014-11-21 16:18 +0530

#81195 — Python Logging and printf()

FromGanesh Pal <ganesh1pal@gmail.com>
Date2014-11-21 16:18 +0530
SubjectPython Logging and printf()
Message-ID<mailman.16095.1416567208.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

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 ?
(2) I feel the  need to retain few print(), how do I ensure the print()
messages are also logged into the log file.



Regards,
Ganesh

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web