Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to filter Chrome console log using a negated text?

Given console log output such as:

...
app.js:4408 update w/ model.location: Discovering
app.js:4408 update w/ action: Animate 911583 { width = 320, height = 480 }
app.js:4408 update w/ model.location: Discovering
app.js:4408 update w/ action: Animate 911609 { width = 320, height = 480 }
app.js:4922 some other log message
app.js:1923 yet another thing on the console
...

Is it possible to get Chrome to remove all lines that include the word "Animate"?

I've tried using a negative lookahead like: .*(?!Animate).* (see also: How to negate specific word in regex?) in Chrome, with no luck.

The regex has been tested at regexpal:

Regex tested at regexpal.com

But it has no effect in Chrome:

Chrome dev tools showing no effect from regex filtering

Being able to just type "!Animate" or "Animate" [x] negate filter would be great. Is that possible, or can anyone get a negate regex to work in this situation?

Thanks.

like image 585
Peter W Avatar asked Aug 08 '16 07:08

Peter W


People also ask

Where are Chrome console logs stored?

Debug logs are stored in the user data directory as chrome_debug. log. The file is overwritten every time Chrome restarts. So, if you have an issue with the browser, check the log before you restart Chrome.


1 Answers

Since chrome 62 you can use negative filters in dev tools.

In the console filter box enter:

-<textToFilter> 

I.e: To remove entries with text "Animate" just type:

-Animate

More info:

https://developers.google.com/web/updates/2017/08/devtools-release-notes#negative-filters

like image 98
user1990009 Avatar answered Oct 16 '22 23:10

user1990009