Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I "Use Logger API to add logs to your project"? (Google Script)

I'm trying to see output of a script, but when I go to "View Logs" I get an alert "No logs found. Use Logger API to add logs to your project."

How do I add the Logger API?

enter image description here

like image 833
Dan Avatar asked Jun 30 '17 12:06

Dan


People also ask

What is the logger service used for in Google Apps Script?

A basic approach to logging in Apps Script is to use the built-in Logger. Logs created this way can be viewed by selecting View > Logs in the script editor. These logs are intended for simple checks during development and debugging, and do not persist very long. * Logs Google Sheet information.

What is a logger script?

Shell Scripting: Expert Recipes for Linux, Bash, and More by logger is a command-line tool that uses the syslog facility present on most Unix and Linux systems. This has a few benefits, one of which is that it allows a non-privileged shell script to write to log files owned by the superuser.

What is Logger log in Javascript?

Logger. Writes the string to the logging console. log(format, values) Logger. Writes a formatted string to the logging console, using the format and values provided.

How do you use TypeScript in app scripts?

Using TypeScript in a Clasp Project You can use clasp to quickly create a new local Apps Script project. This command creates an appsscript. json and Code.gs , the base of an Apps Script project. To use TypeScript in an App Script file, simply rename the file extension from gs to ts .


1 Answers

You will want to add into your code

Logger.log("Yes, this was logged");

Also reference this page for more info: https://developers.google.com/apps-script/reference/base/logger

like image 185
OblongMedulla Avatar answered Sep 28 '22 17:09

OblongMedulla