From the course: Advanced Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Basic logging

Basic logging - Python Tutorial

From the course: Advanced Python

Start my 1-month free trial

Basic logging

- To use Python's logging features, you import the logging module into your app. To send information to the log output, there are individual functions for each kind or level of message. There are five different methods to use for recording log messages. Debug, info, warning, error, and critical. Each of these methods corresponds to a particular type of message which are used to indicate different types of status of the application. Debug messages are typically used to provide diagnostic information that's useful when you are trying to track down a problem. Info messages are usually used to indicate that a particular interesting operation was able to complete normally. Warning messages indicate that something unexpected happened or that a more serious problem might be approaching such as running out of storage space or the inability to communicate with a remote server. Error messages indicate that a particular operation was unable to successfully complete. And critical messages…

Contents