Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to flush the console (make it print immediately)?

I use Firefox + Firebug for some Javascripting. The text I'm trying to log with console.log does not immediately appear in Firebug's console. It seems like it piles up in a buffer somewhere, and then gets flushed to console in chunks. I have a function that makes a few log calls. Sometimes I get just the first line, sometimes - nothing. I do, however, see the whole bunch of lines when I refresh the page.

Can I flush the console log manually?

like image 414
Violet Giraffe Avatar asked Mar 10 '14 16:03

Violet Giraffe


People also ask

What does flush do in print?

Pythons print method as an exclusive attribute namely, flush which allows the user to decide if he wants his output to be buffered or not. The default value of this is False meaning the output will be buffered. If you change it to true, the output will be written as a sequence of characters one after the other.

Which console method can be used to print?

Developers can improve the application debugging process by using methods to print various messages on the browser console. For example, the console. log() method helps us to print messages or data in the browser console.

How do you print a console?

You should use the console. log() method to print to console JavaScript. The JavaScript console log function is mainly used for code debugging as it makes the JavaScript print the output to the console. To open the browser console, right-click on the page and select Inspect, and then click Console.


1 Answers

The short answer is no. There is no flush. You could clear the console

console.clear();

But I don't think that's what you want. This is most likely from the code. If we can see it, I can revise my answer with better feedback.

If you want to see all the available methods under console, execute this in the command line:

for(var i in console) {
    console.log(i);
}

or have a look at the wiki page of the console API.

like image 125
MGot90 Avatar answered Oct 01 '22 02:10

MGot90