2
votes

I've implemented the Channel API w/ persistence. When I make a channel and connect the socket (this is on the real app, not the local dev_appserver), Firebug goes nuts with log messages. I want to turn these off so I can see my OWN logs but cant find any documentation on how to disable the Channel API console logging.

one thing I'm probably doing differently than most is that I'm connecting cross-domain... which the Channel API supports (note the first message in the stream... if you can view that pic)

enter image description here

Does anyone know?


UPDATE

I finally realized that my code was creating two channels and trying to open/connect them both at the same time... and that was why I was getting a flood of messages. I didn't mean to do this (I know the rules: https://developers.google.com/appengine/docs/python/channel/overview#Caveats )... it was a bug... and once I fixed it, the messages went back to manageable level.

yay

2

2 Answers

1
votes

There doesn't appear to be a way to shutoff the Firebug timeStamp log. One way to solve this problem is to edit the code and remove this functionality yourself:

Unpack the extension to a directory in your Mozilla Firefox Profile:

Change directory to your Firefox profile extensions directory. On Ubuntu, this would be something like this:

cd ~/.mozilla/firefox/{random-string}/extensions/

The Firebug extension is identified by [email protected]. Create a new directory of the same name, but without the .xpi, and move the XPI into that directory:

mkdir [email protected]
mv [email protected] [email protected]

Next, change directories to your newly created Firebug directory, and unpack the extension:

cd [email protected]
unzip [email protected]

All of the files should be unpacked so that the extension's directories are in the current directory. Your file structure will look something like this:

$: ~/.mozilla/firefox/{random-string}/extensions/[email protected]$ l
chrome.manifest  defaults/  [email protected]  install.rdf  locale/   skin/
content/         docs/      icons/                              license.txt  modules/

$: ~/.mozilla/firefox/ghlfe0bb.ff5.0/extensions/[email protected]$

Open consoleExposed.js in your text editor:

Next, change to the content/firebug/console directory:

cd content/firebug/console

Edit the consoleExposed.js file using your favorite editor:

vim consoleExposed.js

Disable console.timeStamp:

On or near line 215, you'll see the following function:

console.timeStamp = function(label)
{  
    label = label || "";

    if (FBTrace.DBG_CONSOLE)
        FBTrace.sysout("consoleExposed.timeStamp; " + label);

    var now = new Date();
    Firebug.NetMonitor.addTimeStamp(context, now.getTime(), label);

    var formattedTime = now.getHours() + ":" + now.getMinutes() + ":" +
        now.getSeconds() + "." + now.getMilliseconds();
    return logFormatted([formattedTime, label], "timeStamp");
};

Right after the first curly-brace, force the function to return nothing:

console.timeStamp = function(label)
{   return ;   // disable timestamp by returning
    label = label || "";

    if (FBTrace.DBG_CONSOLE)

Restart Firefox and enjoy a world without timeStamp:

After the edits, restart Firebug. You should no longer see the log messages for timeStamp in your console.

1
votes

On the Development server, when using the ChannelAPI, it essentially degrades into a polling implementation instead of using Comet/long-polling. Thus, in your debugger, you see an endless stream of HTTP requests made to the server to continuously and methodically check for updates.

In essence, these are just AJAX requests, or as Firebug would like to think of them, XMLHttpRequests.

Since your browser is responsible for making these requests, the only way to disable them is to click the small arrow on "Console" in Firebug and uncheck the option for logging XMLHttpRequests.

Uncheck XmlHttpRequest Logging in Firebug

Of course, this also disables logging for all of your other XMLHttpRequests. But it's a small price to pay for the clarity and serenity of a quiet, well-behaved JavaScript console.

For more helpful information on how to make the most of Firebug, see Firebug Tips and Tricks.

NOTE: This works for both users of the Python SDK as well as the Java SDK. (or Go SDK, assuming it has an equivalent ChannelAPI). This is not limited to only Python Appengine.

UPDATE:

From getFirebug:

Creates a time stamp, which can be used together with HTTP traffic timing to measure when a certain piece of code was executed.

The console.timeStamp method was released in Firebug 1.8.0. The same technique described above can also override this Firebug logging method.

console.timeStamp("This is the type of console logging statement that Google is using!");

The above logging statement would produce the olive text. This method can be disabled using the same techniques which were described in the previous section.

However, Google loads the console object inside of a closure, which means that, once Google's code is initialized, the ChannelAPI object has it's own copy of the console object.

In order to disable console.timeStamp, one would need to disable it as the very first action before anything else loads or runs. in other words, we would need to ensure that Google only gets its hands on the disabled console.timeStamp method.

For best results, load this code above the /_ah/channel/jsapi script tag to ensure the console.timeStamp method is disabled before jsapi loads:

if(window.console) console.timeStamp = function(t) { };

NOTE: Because Google invokes Firebug logging in this manner, the only solution may very well in fact require a bug report or feature request that would allow for programmatically disabling this level of logging. Alternatively, the Firebug team could provide a new version of Firebug that includes the ability to explicitly disable timeStamp log statements, similar to how they've done so with Errors, Warnings, XMLHttpRequests, and other log levels.