routing printf output to file

i was used to using cuPrintf which i could route the output to file.

How do i route output to file when using printf [in Fermi boards, for example]

also, cuPrintf was very nice to print out the block and thread numbers for each line; can printf do the same instead of making me do it every time?

Is there an equivalent Restrict function for printf ?


I have asked similar question some time go without any meaningful answer. Stream readers usage for stdout and stderr also does not intercept kernel output (I use approach similar to this one:

If you will be able to find something out about this issue please share your experience.