Skip to content

Instantly share code, notes, and snippets.

@erikeldridge
Created May 16, 2010 03:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikeldridge/402604 to your computer and use it in GitHub Desktop.
Save erikeldridge/402604 to your computer and use it in GitHub Desktop.
A convenience fn for adding meta data to the log in YQL
/**
* A convenience fn for adding meta data to the log in YQL
*
* Usage:
* 1) copy/paste this code into your YQL table's execute block
* 2) Edit the tableName var to match your table's name
* 3) To log the message 'aloha' on line 25, call the logger like this: logger( 'aloha', 25 );
* 4) Look in the diagnostics section of your YQL output to see the log entry
*
* License: Yahoo! BSD http://gist.github.com/375593
* Source: http://gist.github.com/402604
**/
function logger( message, lineNumber ){
// edit this to match your file's name
var tableName = 'table.xml';
y.log( 'table: ' + tableName + ', line: ' + lineNumber + ', message: ' + message );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment