The following examples assume a log format of
[%(name)s - %(level)s] %(message)s
You may want to read the :ref:`survival` to achieve this.
Say you're in myapp/models/music.py
import quicklogging
quicklogging.error("Hello world")
Your output will be:
[myapp.models.music - ERROR] Hello world
Actually you're logging more than once in myapp/views/music.py
and want to optimize:
import quicklogging
logger = quicklogging.get_logger()
logger.debug("Howdy?")
This produces:
[myapp.views.music - DEBUG] Howdy?
then,
logger.warning("plop")
produces:
[myapp.views.music - WARNING] plop