Yup - but not easily, or readily ;o)
Method 1:
You'd have to write your own Javascript parser, compile it into a DLL, and plug into your browser.
Then enable a logging option and voila!
You might try searching on the net - someone may well have already written one.
Method 2:
You could over prototype major functions - the functions you want to log. Then in these functions, create an (or just use an already-present) iframe, build a hidden form in it, set a hidden field to the value of what you want to log, submit it to a server-side process that builds an html file, then display that html file.
Both are valid solutions, and would work in theory... But the practice I'll leave to you ;o)
Hope this helps,
Dan