Search code examples
javascriptgoogle-app-enginefirebugchannel-api

How do I turn off the console logging in App Engine Channel API?


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


Solution

  • 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 firebug@software.joehewitt.com.xpi. Create a new directory of the same name, but without the .xpi, and move the XPI into that directory:

    mkdir firebug@software.joehewitt.com
    mv firebug@software.joehewitt.com.xpi firebug@software.joehewitt.com
    

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

    cd firebug@software.joehewitt.com
    unzip firebug@software.joehewitt.com.xpi
    

    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/firebug@software.joehewitt.com$ l
    chrome.manifest  defaults/  firebug@software.joehewitt.com.xpi  install.rdf  locale/   skin/
    content/         docs/      icons/                              license.txt  modules/
    

    $: ~/.mozilla/firefox/ghlfe0bb.ff5.0/extensions/firebug@software.joehewitt.com$

    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.