Hide warning messages in console window - google-chrome

The Chrome console window is full of warning messages that I like to hide.
Is it possible to hide the warning logs?
I only want to show my custom logs e.g. console.log('mymessage');
This is how the console windowbar looks like:

Just recently there was a Chrome update. Now filtering single message types is possible (Verbose, Info, Warnings, Errors)! (My Version: Version 60.0.3112.90)
When opening the console, instead of selecting a "filter level", you can now check or uncheck each message type.

As of Chrome version 78 (Dec 2019), in the "Console" tab, click on the "Default levels" pulldown, and uncheck the types of messages you don't want displayed.

At the top bar of the console log you can select what kind of messages should be shown.
All is selected by default. Select error to see only error.
You can press ctrl + click to select multiple message types.

First off: you can hide all warnings and show only console.log output if you are using Microsoft Edge. In the console, there are a couple of icons representing the different levels of log output you may be using - error, warning, and info. If you just want to hide warnings, you can simply toggle the warning icon to off.
Also, if you are on firefox, you can set the log to only display info, in which case the warnings will also be hidden.
Next, to elaborate on the other answer, and phrase what I said (above in my comment) in the form of an answer:
For chrome, you cannot toggle specific levels off individually (newer versions of Chrome). Instead, you have to set an overall verbosity level for the log. By using the strictest level (i.e. the level that displays the least), you can minimize console messages that are created by portions of code that you did not write. In this case, that is the error level.
If you are just trying to hide warning messages for testing purposes, you can, for the time being, switch over to only logging messages at the error level. In production, this is not good practice, as it doesn't let you differentiate between helpful info log messages or actual errors.
To log a message as an error, use:
console.error('mymessage');
Then, as mentioned above, you can change the Level of your console output to error, which will only show you error messages. It will ignore console.log as well as any warning messages.
Be sure to change your calls to console.error back to console.log when you are done with the development phase of your work, for any instances where you are calling console.error with some message that does not describe an error.
Now, if you are getting warnings due to something you are doing in your code, you may want to consider spending time trying to correct whatever is causing those warnings to appear. Warnings are generally well thought out, and are there to help you prevent issues in your code that you may not be aware of. Correcting any issues in your code would also cause the warning messages to go away.
NOTE: you cannot tell the console to only display messages you print out, even at the level of verbosity you set your console to. This is because the console would have no way of knowing which statements you are logging out, versus which statements code your webpage is running that was written by someone else is logging out. The steps mentioned in this answer as well as the other are workarounds that may improve your situation.
UPDATE: It seems like Chrome has reintroduced the ability to enable/disable different levels of console logging individually. Now, when clicking on log level, you can toggle whether certain log levels are enabled or disabled.

Under the console tab it is now possible to highlight the message type as a general filter. There is also a filter box right next to the eyeball. So if you put a unique flag in your console.log then it will show only your messages with this flag.
But in general. I think you want to click the 'Info' item as highlighted below to just obtain the console.log messages

There is a drop down next to filter, where can you select only things you require.
Note : ReactJS warnings are actually displayed in red as errors. So to remove them you need to uncheck errors too.

Related

PhpStorm. Highlight file in project tree on inspection error (e.g. Strict type checking rules violation)

Is it possible to highlight a file in the project tree on inspection error (e.g. Strict type checking rules violation) in PhpStorm?
I would like to highlight it as a serious error. Couldn't find anything in settings and documentation.
Now it just highlighted the wrong property and mark the line on the right.
v
I thought it would be possible by changing the Inspection Severity to the highest Error level (see the official doc page on how to configure Inspection Severity)... but apparently this will not work.
It seems that right now only certain hardcoded error types (that come from lower level Lexer/Parser as I understand) can display the "red underwave" in the Project View panel.
Watch the following ticket: PhpStorm's WI-33552 --> platform-wide IDEA-96288 (star/vote/comment) to get notified with any progress.
It's not the same of course, but will give yo an overview on a most-important errors (for your filtering level/inspection profile).
As a possible alternative: Run Inspect Code manually (Code | Inspect Code from the Main Menu; you can invoke it for a specific folder/custom scope to limit the number of files to be processed) and then filter you results in the Problems toolwindow to only see the errors with required severity.
https://www.jetbrains.com/help/phpstorm/running-inspections.html#run-inspections-manually
https://www.jetbrains.com/help/phpstorm/problems-tool-window.html#854a2648

Is it possible to get a stack trace for chrome console warning?

React warned me about bad state logic somewhere:
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op.
When I click the line number, it points to a console.warn line in the React source code. How can i see where in my code the warning is coming from? Is there a way to get a stack trace from warn?
It's hard to track down when there's > 20 distinct components.
when you are inspecting the react source code in chrome, you can click on a line number to add a break point.
Once you refresh the page, the debugger will halt at the given line and via the call stack on the right you then can see how you got there.
Google chrome show stack traces for warnings:
But chromium does not:

Has the Chrome console's autocomplete feature gotten more aggressive?

It seems like lately I have been having been getting hung up on the auto-completion drop down when using the console in Chrome DevTools. It seems like it has suddenly gotten more aggressive. I have never had a problem with the feature until the other day when I was trying to enter commands into the console quickly in order to test things. I wasn't sure why it wasn't working right. when I'd hit Enter auto-completion kept popping up and not executing what I typed. At first it seems as if auto-completion was activating whenever I would hit Enter to execute my code. However, it began to look like it was only popping up when I would end a statement with ;.
For example, typing the following statement into the console and pressing Enter would not cause the autocomplete drop down to activate:
console.log('did it')
However, if I add a semicolon then as soon as I press ; a number of milliseconds later the autocompletion feature immediately pops up:
console.log('did it');
At this point if I press Enter it will simply select the first entry, $, and add it as the next statement so we get:
console.log('did it');$
I know this is not really a big deal, after all, the only reason you would need the semicolon is for entering in multiple statements. However, I feel like in the past I've always added a semicolon ; to the end of simple single test statements such as the console.log shown above not activated the auto-completion, being able to execute it by just hitting Enter.
I definitely feel like my console's auto-completion is being activated more aggressive than it used to.
Has anyone else felt like the auto-completion in the console is activating too often all of the sudden? I am wondering whether or not this could have actually been changed in Chrome or if somehow I have made my console start acting this way with a setting or something?
While writing this I noticed that it seems not to only be after ; that auto-completion seems to pop up when it hadn't before. If you refer to Chrome DevTools - Using the Console you'll see that auto-completion is only referred to once:
The Console attempts to evaluate any JavaScript expression you enter at the shell prompt, upon pressing the Return or Enter key. The Console provides auto-completion and tab-completion. As you type expressions, property names are automatically suggested. If there are multiple properties with the same prefix, pressing the Tab key cycles through them. Pressing the right arrow key accepts the current suggestion. The current suggestion is also accepted by pressing the Tab key if there is only one matched property.
After this it goes on to say that we can use Shift+Enter in order to enter a multi-line expression and it gives the following example:
(source: google.com)
This is something I know for sure I have done plenty of times in the past with no problems from auto-completion. When I try to type the code in the above image I get as far as:
var add = function (val1, val2) {
Then when I press Shift+Enter instead of going to a new line like I am positive it did before (for me at least). Apparently anytime a new statement is started it will pop up. Has anyone else started getting highly annoyed at this feature as of very recently? Does anyone know if there's a way I could have caused this behavior?
Whoever answered my question before deleted their answer. I would like to close the question as it has been answered. This is indeed a bug as stated in the comments above and on the deleted answer. Anyone else that is here because they are experiencing problems as well will have to wait for the release to make it down to their version of Chrome, with Canary getting it first of course. You could presumably install an earlier version of Chrome to get around this as well. I know this is not directly about coding, but I see no reason to close it now when others may find the information useful.
Link to the Chrome Issue referencing this problem: https://code.google.com/p/chromium/issues/detail?id=263925

Why does my code produce a different result on occasion in apps-script?

I have a very strange problem. I load my app, switch to the correct tab and then press the button I need to press. This runs a function and when I first load the page it may only provide part of the correct result. However if I wait a few seconds it produces the correct result in full. Any ideas why this might be happening?
Additional Information
The button simply checks through a list of objects returned via ScriptDB. Objects that are valid are displayed and objects that are in-valid are not. If the object appears again in updates the text to display how many have been found in the list (eg: the label would change from "Object A" to "Object A (2)").
It seems to me like it doesn't have the rest of the list somehow as it doesn't always stop at the same object. It's Very strange and not something I've experienced before. The other features of my app using ScriptDB work completely regardless of how quickly I use them.
I've figured it out now. I somehow had some erroneous data in the database which was returning a null field. I can only assume that this was from a import that I did last week from a spreadsheet.
This was copied from my comment to show that it has been resolved.

How to Prevent the "Please tell Microsoft about this problem" Dialog Boxes

We have an error that we can't seem to find and don't have the need/resources to try and track it down. What we do need to do is just keep the freaking "Please tell Microsoft about this problem" dialog boxes from cluttering up the server.
It is from an MS-Access error (we think) but I can't find where Access is installed (I don't think it is); there is no MS Office directory on any of the drives.
If we could just stop the dialog boxes from appearing that would be great.
Thanks.
Spec: Window Server 2003 sp2
From http://www.codeproject.com/KB/exception/UnhandledExceptionClass.aspx:
If you also want to disable the Windows “Send Error Report” dialog on your computer, right-click on the “My Computer” icon, select “Properties”, switch to the “Advanced” tab, and click on the “Error Reporting” button. In the Options dialog, select the “Disable error reporting” radio button:
Compare also http://www.codeproject.com/KB/exception/ExceptionHandling.aspx for general .NET Exception Handling sanity.
I don't think you realize jusy how serious this error might be. These errors pop up under severe conditions like buffer overflows, null pointer dereferences, division by zero errors, etc. Given that you mentioned that this runs on a server, you potentially (depending on your situation) have a network facing, easily exploitable program!
As others have suggested, you can turn off error-reporting system wide, or you can use the SetErrorMode API to disable it for just your application, but again I would strongly advise to investigate and fix the problem at its root!
Well, I would try and figure out what application is using Access. Not knowing what is running is a real issue, especially when it is having unhandled exceptions!
As far as just disabling?
Try:
Right click 'My Computer'
left click 'Properties'
left click 'Advanced' tab
left click 'Error Reporting' (near bottom)
left click 'Disable error reporting'
It's called the Windows Error Reporting Dialog. You can disable it by following these instructions:
http://www.windowsnetworking.com/articles_tutorials/Disable-Error-Reporting-Windows-XP-Server-2003.html
However, I would be concerned with why you are getting those error messages. You are just concealing a problem which could be very bad.
Since I see three different people posted instructions on how to disable the dialog on their own machine, I'll post this again as an answer instead of just a comment:
They don't want to do that on their customer's machines, because that will disable any application from using the dialog. They just want to prevent it from coming up for their application.
It's not concealing anything, if a program crashes windows will still tell you. The difference is that it won't compile a core dump and try to send it to microsoft for you. It's very useful to disable this garbage.
When working in .net, you can catch all unhandled exceptions (which is what causes this message). But I'm not aware of a way to do the same in Access.
http://devcity.net/Articles/60/1/unhandled_exceptions.aspx