Clears all messages from the execution log.
class Logger method .clear()
Logger is the Apps Script service.
.clear() is the method name you will see after a dot in your code.
What it does
Why it's used
- Wipe old debug output before a clean test run.
- Reset logs when iterating locally.
Common errors
- Forgetting parentheses on clear. Write Logger.clear(), not Logger.clear or clear by itself.
- Skipping dots between chained calls. Each step needs a dot, like Logger.clear().
- Adding spaces where they do not belong. Write Logger.clear(), not Logger .clear(), Logger.clear (), or Logger . clear().
- Wrong capitalization. Use Logger and clear, not logger or clear.
Explore
Related methods
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.
Related blog posts
Written guides about Logger.clear().