lammertb / libhttp

Multi platform HTTP and HTTPS library
MIT License
957 stars 131 forks source link

Error handling should support debug levels #32

Closed lammertb closed 7 years ago

lammertb commented 7 years ago

Currently error messages are either logged or discarded. It would be better to sort them in groups like informational, warning, error and failure and switch logging of them on and off with run time settings. Also grouping of errors based on subsystem (socket errors, file errors, general errors, etc) could be possible to give the application further control about the messages they will receive or ignore.

lammertb commented 7 years ago

Debug levels have been added in https://github.com/lammertb/libhttp/commit/a03f2e301f1d128f41e161a3ffddd90c55ed6771

Current debug levels are: DEBUG_LEVEL_NONE - nothing is reported DEBUG_LEVEL_CRASH - problems affecting many connections in a severe way are reported DEBUG_LEVEL_ERROR - problem affecting single connections in a severe way are reported DEBUG_LEVEL_WARNING - problem causing some minor issues on single connections are reported DEBUG_LEVEL_INFO - informational messages with no impact on communication quality are reported