Closed andersgs closed 5 years ago
A good convention is to put at the top of each *.py file or module:
*.py
import logging logging.basicConfig(format='[%(asctime)s] %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INFO) logger = logging.getLogger(__name__)
Then call logger wherever needed (e.g., logger.info("Starting up"))
logger
logger.info("Starting up")
Done
A good convention is to put at the top of each
*.py
file or module:Then call
logger
wherever needed (e.g.,logger.info("Starting up")
)