decorator to trace code execution