Python

logging module (Python)

Në shqip: Moduli logging

ShpjegimiSQ

Në vend të print-it, moduli logging shkruan mesazhe me nivel (DEBUG, INFO, WARNING, ERROR), orë dhe vend — dhe mund t'i ruajë në skedar. Kur programi rritet, të ndihmon ta gjesh shpejt problemin.

EnglishEN

Instead of print, the logging module writes messages with a level (DEBUG, INFO, WARNING, ERROR), time and location — and can save them to a file. As a program grows, it helps you find problems quickly.

Si ta mendosh

Si ditari i kapitenit të anijes: çdo ngjarje me orë dhe rëndësi.

Lexoje në anglisht

Like a ship captain's log: every event with a time and importance.

Shembull kodipython

import logging
logging.basicConfig(level=logging.INFO)
logging.info("Filloi programi")
logging.warning("Skedari mungon")

Terma të lidhur