Recently, console logging became available for Google Apps Script projects. It used to
be impossible to use the Log service that comes with the GAS runtime, but now all
you need to do is throw
an exception. Exceptions get logged in stackdriver logging and
when enabled, unhandled exceptions will not stop your script execution. This adds up
to nearly 0 lag if you are using this feature (?) by purposely throwing exceptions, and you
can get creative with your error message to avoid having to expand stackdriver's log messages
(which are pretty comprehensive stacktraces!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function exportSpreadsheet() { | |
//All requests must include id in the path and a format parameter | |
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export | |
//FORMATS WITH NO ADDITIONAL OPTIONS | |
//format=xlsx //excel | |
//format=ods //Open Document Spreadsheet | |
//format=zip //html zipped | |