improved diagnostics logging