Amazon VERSION 2.0V1 Betriebsanweisung Seite 31

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 264
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 30
31
Logging Exceptions
Exceptions can be logged in a way that automatically includes traceback information in the log message, as in the
following example:
import logging
try:
i = 1 / 0
except Exception as exception:
logging.exception("Error in computation: %s"
% str(exception))
Run in the Python tab, this produces a log message with the following text:
Error in computation: float division
Traceback (most recent call last):
File "<string>", line 4, in <module>
ZeroDivisionError: float division
5 MESSAGE LOGGING | LOGGING EXCEPTIONS
Seitenansicht 30
1 2 ... 26 27 28 29 30 31 32 33 34 35 36 ... 263 264

Kommentare zu diesen Handbüchern

Keine Kommentare