Is Chrome’s JavaScript console lazy about evaluating objects?

Thanks for the comment, tec. I was able to find an existing unconfirmed Webkit bug that explains this issue: https://bugs.webkit.org/show_bug.cgi?id=35801 (EDIT: now fixed!) There appears to be some debate regarding just how much of a bug it is and whether it’s fixable. It does seem like bad behavior to me. It was especially troubling to … Read more

Difference between console.log() and console.debug()?

Technically console.log console.debug and console.info are identical However the way they display the data is little different. console.debug is not visible by default in the browser’s JS console. It can be enabled by using the console’s filter options. console.log Black color text with no icon console.info Blue color text with icon console.debug Pure black color … Read more

What is console.log?

It’s not a jQuery feature but a feature for debugging purposes. You can for instance log something to the console when something happens. For instance: $(‘#someButton’).click(function() { console.log(‘#someButton was clicked’); // do something }); You’d then see #someButton was clicked in Firebug’s “Console” tab (or another tool’s console — e.g. Chrome’s Web Inspector) when you … Read more

Configure Node.js to log to a file instead of the console

You could also just overload the default console.log function: var fs = require(‘fs’); var util = require(‘util’); var log_file = fs.createWriteStream(__dirname + ‘/debug.log’, {flags : ‘w’}); var log_stdout = process.stdout; console.log = function(d) { // log_file.write(util.format(d) + ‘\n’); log_stdout.write(util.format(d) + ‘\n’); }; Above example will log to debug.log and stdout. Edit: See multiparameter version by … Read more

JavaScript console.log causes error: “Synchronous XMLHttpRequest on the main thread is deprecated…”

This happened to me when I was being lazy and included a script tag as part of the content that was being returned. As such: Partial HTML Content: <div> SOME CONTENT HERE </div> <script src=”https://stackoverflow.com/scripts/script.js”></script> It appears, at least in my case, that if you return HTML content like that via xhr, you will cause … Read more

What is console.log?

It’s not a jQuery feature but a feature for debugging purposes. You can for instance log something to the console when something happens. For instance: $(‘#someButton’).click(function() { console.log(‘#someButton was clicked’); // do something }); You’d then see #someButton was clicked in Firebug’s “Console” tab (or another tool’s console — e.g. Chrome’s Web Inspector) when you … Read more

Can’t access object property, even though it shows up in a console log

The output of console.log(anObject) is misleading; the state of the object displayed is only resolved when you expand the Object tree displayed in the console, by clicking on >. It is not the state of the object when you console.log‘d the object. Instead, try console.log(Object.keys(config)), or even console.log(JSON.stringify(config)) and you will see the keys, or … Read more

How can I get the full object in Node.js’s console.log(), rather than ‘[Object]’?

You need to use util.inspect(): const util = require(‘util’) console.log(util.inspect(myObject, {showHidden: false, depth: null, colors: true})) // alternative shortcut console.log(util.inspect(myObject, false, null, true /* enable colors */)) Outputs { a: ‘a’, b: { c: ‘c’, d: { e: ‘e’, f: { g: ‘g’, h: { i: ‘i’ } } } } }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)