9

I am trying to watch my javascript code using the console.log(text) command - and it does work... but the console gets flushed everytime the url changes.

Is there any way to persist my console logs between page changes?

Ciel
  • 17,312
  • 21
  • 104
  • 199
  • 1
    [In Chrome] It looks like you can preserve the Network activity log between navigation but not the console itself. Take a look at an identical question http://stackoverflow.com/questions/5928492/google-chrome-developer-tool-preserve-console-record – Colin Jun 08 '11 at 14:39

4 Answers4

17

Click on the bottom-right corner gear icon in the Chrome developers tool, check 'Preserve log upon navigation' option and you are done.

Widor
  • 13,003
  • 7
  • 42
  • 64
SapC
  • 171
  • 1
  • 2
4

For the record, these days both Firefox and Chrome have 'persist' options in their inspectors / conosole. You need to right click in the console window and then select the relevant option tfrom the popup menu.

gotofritz
  • 3,341
  • 1
  • 31
  • 47
2

There isn't a way to do this yet but from what I've read it is a future feature they will implement. Here is the Issue ticket on it: http://code.google.com/p/chromium/issues/detail?id=77058


EDIT: Chrome has implemented this feature. Read the answer below

Community
  • 1
  • 1
scrappedcola
  • 10,423
  • 1
  • 32
  • 43
  • Firefox's firebug does have a persist option though. – scrappedcola Jun 08 '11 at 14:36
  • Since you don't care for the current firefox (you could use an older version for js testing), if you are just looking at the request headers(and not debugging stuff) you could use fiddler with chrome to watch the requests/responses. – scrappedcola Jun 08 '11 at 16:33
  • Both of these were good answers. I had a difficult time picking which to award as the solution. – Ciel Jun 09 '11 at 13:13
  • go and read the next comment, there already is the option added in chrome dev tools :) – ptica Sep 26 '13 at 08:15
  • @ptica yea there is one now but if you notice this was from 2 years ago before they implemented that feature hence "it is a future feature they will implement" :).So yea my answer is quite obsolete now. – scrappedcola Sep 26 '13 at 16:16
  • understood - I felt the urge to comment after I read the accepted answer and comments up there a almost closed the browser with despair :) – ptica Sep 26 '13 at 20:23
1

There's only 1 way that I know of, but not with Chrome: With the built-in Web Inspector in Firefox 4+, which doesn't flush the logs between pages.

@scrappedcola notes that Firebug does this as well, but I'm referring to the built-in inspector.

Yahel
  • 37,023
  • 22
  • 103
  • 153
  • Actually any version of firefox with firebug you can persist console sessions. – scrappedcola Jun 08 '11 at 14:38
  • I would rather use Chrome. The new version of FireFox is ... I don't care for it. But if that's the only way to do it, I guess I have no choice. – Ciel Jun 08 '11 at 14:49
  • Both of these were good answers. I had a difficult time picking which to award as the solution. Thank you very much for the information. – Ciel Jun 09 '11 at 13:13