LANG SELRCT

Apps Script Reference  (Create: Create new Spreadsheet | Create new Apps Script

Monday, July 16, 2018

console.log()でGoogle Cloud Platformにログを出す(Stackdriver Logging)


Logger.logでは省略されるログをStackdriver Loggingで出せることを知ったので備忘録として書き残しておきます。

※この記事を書いた後に仕様変更があり、新しく作られたスクリプトプロジェクトからStackdriverのログに直接アクセスするには、標準のGCPプロジェクトを使用する必要があるようです。
Stackdriver logs are attached to the GCP project associated with your Apps Script. You can view a simplified version of these logs in the Apps Script dashboard. To make full use of Stackdriver Logging and its capabilities, use a standard GCP project with your script project. This lets you access Stackdriver logs directly in the GCP Console and gives you more viewing and filtering options.
using_stackdriver_logging



コード.gs内でconsole.log("出したいログ")を書いて
myFunctionを実行して


表示>Stackdriver Loggingを開くと

このようにログを出せる



補足




コード.gs
function myFunction() {
  console.log("出したいログ");
}


参考

Latest post

スプレッドシートA列にある複数のテキストをスライドに追加したい(Google Apps Script)

今回Google Apps Scriptでやりたいこと GoogleスプレッドシートA列にある複数の値を取得して Googleスライドに渡して 図形オブジェクトのテキストとして追加したい ① スプレッドシートのA列に値を入れておく ② Code.gsのinsertNewShape...