, , :
,
:
import logging
def whoami():
logging.info("Now I'm there")
def foo():
logging.info("I'm here")
whoami()
logging.info("I'm back here again")
logging.basicConfig(
format="%(asctime)-15s [%(levelname)s] %(funcName)s: %(message)s",
level=logging.INFO)
foo()
2015-10-16 16:29:34,227 [INFO] foo: I'm here
2015-10-16 16:29:34,227 [INFO] whoami: Now I'm there
2015-10-16 16:29:34,227 [INFO] foo: I'm back here again