logging: Remove some code duplication

Extract the mapping of the subsystem number and the checking for
the loglevel to a inline method that is shared between the new
and old.
1 file changed