A unified approach to formal local cohomology and local Tate cohomology