X
X
xozzslip2016-03-29 15:49:04
Python
xozzslip, 2016-03-29 15:49:04

How to organize the output of auxiliary information to the console in the application?

I would like to display information about the current state of script execution to the console, but a large number of print in functions pretty much spoil, in my opinion, readability, and indeed the structure in general. Where to dig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Bulat Kurbangaliev, 2016-03-29
@ilov3

import logging
logger = logging.getLogger(__name__)
logger.info('log message')
more details here:
https://docs.python.org/2/howto/logging.html

V
Vov Vov, 2016-03-29
@balamut108

I've been using logger for a long time. I can send you a sample code too.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question