After reading:
How to count the actual occurence of a warning message in a Do loop?
I wonder about a broader question: how to count the number of occurences of a warning messages in the current session ?
My first try was
counter[arg_] := Module[{}, count++; Return[arg]];
$MessagePrePrint = counter[#] &;
count = 0;
count
Do[1/0, {k, 1, 3}];
count
Obviously,
count
Quiet[Do[1/0, {k, 1, 3}]];
count
doesn't increment the counter.
Now, to keep a tally of all message and hide them, I experimented
counterQuiet[arg_] := Module[{}, count++; Return[Null]];
$MessagePrePrint = counterQuiet[#] &;
count = 0;
count
Do[1/0, {k, 1, 3}];
count
but it isn't a smart trick, because this way messages are still visible, albeit containing Null instead of the original argument.
Can the goal be achieved without redirecting stderr to a dummy stream ?
Otherwise, how to implement the redirection and still count messages?

This solution was completely beyond my capability, owing to my lack of deep understanding of MessageList. It rises to me more doubts about MessageList, and I will post them as detached questions.
P.S. Please, feel always free to remark upon my error in English. I will edit my questions to adjust them.
– mitochondrial Oct 06 '15 at 07:36