Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

injecting log to any javascript function #51

Open
wants to merge 10 commits into
base: master
from

refactored

  • Loading branch information
dhewzulla committed Nov 8, 2017
commit 6dd1a84dcffddaae1abe19a818bbc8d4137c58cf
@@ -183,14 +183,6 @@
document.cookie = LOGGLY_SESSION_KEY + '=' + value;
},
injectedList:{},
getTargetObjectFromString:function(targetObjectName){
try{
return eval(targetObjectName);
}
catch(error){
return null;
}
},
injectLog:function(request){
if(!request.enable){
return;
@@ -212,7 +204,14 @@
if(targetparts.length<=1){
return;
}
var targetObject=this.getTargetObjectFromString(targetparts[0]);
var targetObject=null;
if(request.targetBase && typeof request.targetBase === 'object'){
targetObject=request.targetBase;
}
else{
targetObject=this.getTargetObjectFromString(targetparts[0]);
}

for(var i=1;(i+1)<targetparts.length;i++){
if(!targetObject){
return null;
@@ -272,6 +271,14 @@
return ret;
};
},
getTargetObjectFromString:function(targetObjectName){
try{
return eval(targetObjectName);
}
catch(error){
this.track({logglyconfigerror: "loggly config eval error:"+error+" the device may not support evail, consider use targetBase"});
}
}

};

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.