[tidy] added warning logs and sanity assertion