Cohomology of higher categories