Fix function logging wrapper