问题
I've just transitioned to V8 of google apps script. I'm updating my previous scripts. all of my Logger.log("Hello World");
statements behave differently. Previously i could hit ctrl+enter which would bring up the "Logs" screen. Currently those logger statements don't show up there and I get a message that "No Functions have been run in this editor session". I am able to open the executions screen and find the Logger statements there. The problem with that few is it only time stamps to the second. Previously the "Logs" screen would time stamp down to the 1000th of a second.
回答1:
Apparently this is a change and is working as it's supposed to. Only Script run directly from the editor will go into the "Logs" screen and all others (such as triggering a script from a google sheet) must be tracked in executions. If scripts are run directly from the editor they do show up in the "Logs" Screen and this does still timestamp down to 1/1000th of a second. Items tracked in the executions screen are limited to every second which is also an intended behavior at this time.
来源:https://stackoverflow.com/questions/64305032/why-does-logger-log-statements-not-show-up-in-logs