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.
Snippets using this method
Explore
Related methods
More Apps Script
Better Sheets tutorials
Scrape Google Maps
Scrape Google Maps Added Phone and Reviews
Related blog posts
Written guides about Logger.clear().