[PATCH 07/12] util: introduce common helper for error-report & log code