24
24
*
25
25
* @returns {string } The eventId for the error.
26
26
*/
27
- function logError ( o ) {
27
+ function logError ( o ) {
28
28
var settings = new settings ( ) ,
29
29
de = settings . de . logError . Name ,
30
30
name = [ ] ,
@@ -587,7 +587,8 @@ function isCustomerKey(str) { return RegExp('^[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Z
587
587
* @returns {object } Result of the request
588
588
*/
589
589
function httpRequest ( method , url , contentType , payload , header ) {
590
- var req = new Script . Util . HttpRequest ( url ) ;
590
+ var log = log || new logger ( "httpRequest" ) ,
591
+ req = new Script . Util . HttpRequest ( url ) ;
591
592
req . emptyContentHandling = 0 ;
592
593
req . retries = 2 ;
593
594
req . continueOnError = true ;
@@ -599,7 +600,7 @@ function httpRequest(method,url,contentType,payload,header) {
599
600
if ( typeof payload !== 'undefined' && payload !== null ) { req . postData = Platform . Function . Stringify ( payload ) ; }
600
601
601
602
try {
602
- log . debug ( '[httpRequest] - Request with method [' + method + '] on URL [' + url + ']' ) ;
603
+ log . trace ( '[httpRequest] - Request with method [' + method + '] on URL [' + url + ']' ) ;
603
604
var res = req . send ( ) ;
604
605
605
606
return {
@@ -608,7 +609,7 @@ function httpRequest(method,url,contentType,payload,header) {
608
609
} ;
609
610
610
611
} catch ( e ) {
611
- log . warn ( '[httpRequest] - Failed to do HTTP request on [' + url + ']' )
612
+ log . trace ( '[httpRequest] - Failed to do HTTP request on [' + url + ']' )
612
613
return {
613
614
status : '500' ,
614
615
content : e
@@ -767,7 +768,8 @@ function createAmpVariablesFromObject(ssjsObject,prefix,delimiter) {
767
768
* %%=TreatAsContent(@githubContent)=%%
768
769
*/
769
770
function getGitHubRepoContent ( obj ) {
770
- var url = 'https://api.github.com/repos/' + obj . username + '/' + obj . repoName + '/contents/' + obj . filePath ,
771
+ var log = log || new logger ( "getGitHubRepoContent" ) ,
772
+ url = 'https://api.github.com/repos/' + obj . username + '/' + obj . repoName + '/contents/' + obj . filePath ,
771
773
header = {
772
774
"Authorization" : "Bearer " + obj . token ,
773
775
"User-Agent" : obj . username + '/' + obj . repoName ,
0 commit comments