An example implementation of a logger that collects messages until it is triggered by some event of a certain level. Then it dumps all collected messages.