jeudi 15 septembre 2022

How to implement warning / error message reporters library

I`ve started to work on some project. Their error reporter mechanism doens`t look good

  1. Every time they find an error they prepare string (locally)
  2. Report it via some function It is very inconvenient - the project is big and looks that the better way to have some module which has all error message concentrated in some file/data structure. When error occurs just report an error by its id and appropriate string will be emitted. The possible issue is that thre are some errors which are parametrized by some runtime info Is there some project / design that you can advice for such error reporter. How to handle parametrized error (number of parameters (and types) vary for different errors - could be one int or 10 strings , etc) Thanks

Aucun commentaire:

Enregistrer un commentaire