Add-on log error/warning sensor?

How would I go about creating a sensor that alerts me of the presence (ideally number) of errors/warnings happening in an add-on log (zigbee2mqtt in my case). I want to use it to be alerted once z2m gets unhappy about something and not just when I notice that things stopped working.