If you've never worked with a logger before, you might wonder what the difference between certain log levels is. Of course, you can use them for whatever purpose you want, but the following conventions are usual for loggers in many languages:
Log level | Usage | Example |
Error | Some major problem occurred that might terminate the program soon. If the application is a service that should always run, a system administrator should immediately be notified. | The connection to the database has been broken. |
Warn | An issue that's not severe or has an automatic workaround has happened. Someone should check this out at some point and fix it. | A user's configuration file contains unrecognized options that have been ignored. |
Info | Some information that might be useful to look at at a later point. This logs normal conditions. | The user has started or stopped a process. A default value has been used because no configuration has been provided. |
Debug | Information that... |