1

Why this error?

ReferenceError: logger is not defined (line 4)

function myFunction() {
  var res = UrlFetchApp.fetch("https://api.cartolafc.globo.com/mercado/destaques");
  var content = res.getContentText();
  logger.log(res);
  logger.log(content);
}

1 Answer 1

2

Try Logger.log instead.

Logger is the name of the class and log is a method of this class. There is not a built-in class in google scripts called logger.

You can also use console.log if you have V8 enabled.

See details here .

Sign up to request clarification or add additional context in comments.

1 Comment

console.log perfect solution, thanks mate! I'm waiting 5 minutes to mark your answer to solution for my problem!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.