WL#11875: update early "buffered" logging to make full use of the new error logging system

Affects: Server-8.0   —   Status: Complete

Information passed to the logger before it is told what to log and what file to 
log to is collected in a buffer, and printed once we know where to. This system 
predates the new rich logging system and is somewhat simple. On one hand, it uses 
the value of log_error_verbosity active when the error was thrown, not when it is 
later printed. This means that for events occurring before arguments from the 
command-line or my.cnf (or SET PERSIST) are processed, the default value of 
log_error_verbosity will apply:

mysqld ... --log-error-verbosity=1

for instance will show some warnings generated before the verbosity was set to 
"errors only", which leads to surprising behaviour and bug tickets. Similarly, 
the buffering mechanism, not being aware of the capabilities of the new logging, 
will only buffer information used in the default error-logging format. This 
prevents some of the richer filtering (e.g. --log-error-suppression-list) and 
logging that should be available when more powerful log services are used, and 
thus once more produces slightly surprising behaviour.


Buffered logging should buffer all information passed to it, not just a subset, 
and then flush it to the appropriate logs using the settings and services 
requested by the user once those settings have been obtained. This will provide 
richer logging and better filtering even for early messages, bring the behaviour 
more in line with later logging, and make overall server behaviour less 
surprising.