Fire a function whenever trace is called?

Is it possible to

firstly:
fire a function whenever trace is called?

secondly:
pass the trace arguements to that function?

I am building a debugger window for online sites

Cheers :beer2: