Skip to content

Instantly share code, notes, and snippets.

@enjalot
Created March 1, 2013 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enjalot/5061473 to your computer and use it in GitHub Desktop.
Save enjalot/5061473 to your computer and use it in GitHub Desktop.
log jacking
{"description":"log jacking","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"util.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/56h5fSq.png"}
var a = 5;
//console.log("hi", a);
var b = [1,2]
var c = [a].concat(b);
console.log(c);
console.log("hi", a);
//tributary.asdf("HI",a)
if (typeof console !== "undefined") {
console.logJack = console.log;
//tributary.asdf = function() {
console.log = function() {
var trace = new Error().stack;
//console.log("TRACE", trace);
var match = trace.match(/Object\.eval \[as initialize\].*\<anonymous\>:([0-9]+)/)
var args;
if(match) {
//console.logJack("MATCH", match[1]);
args = ["line " + (+match[1]-1) + ":"].concat([].splice.call(arguments,0))
} else {
args = arguments
}
console.logJack.apply(console,args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment