I have an application that reads a database and outputs alerts to any dependencies that are not being met. My thinking on this issue is ‘Give the minimum information that points the user to the issue.’ I have been told by a co-worker that I should be as verbose as possible, printing out the values of the database fields for each field I mention verses giving the minimum message that ‘field one needs to be less then field two’.
I know that there must be some convention or standard for this issue as it reminds me of compiler errors and warnings. Does anyone know how a compiler messages are are chosen?
What suggestion does the community have for this issue?
When writing, know your audience.
If you’re logging warning/error messages for your own consumption, then it’s fairly easy: what do you need to know when something goes wrong?
If you’re logging warning/error messages for someone else, then things get tricky. What do they know? What does their mental model of the system look like? What sorts of problems can they solve, and what information do they need to solve them?
Pushing every last scrap of data into a message is punting – at best, the reader will have to wade through irrelevant information in order to find what they need; at worst, they’ll become confused and end up making decisions based on the wrong data.
The compiler analogy is apt: think how annoying it would be if the entire symbol table was dumped along with every warning…