Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Globally toggle echos on and off
ResourceFunction["ToggleEcho"][] toggles the Echo family of functions off and on.  | |
ResourceFunction["ToggleEcho"][flag] disables or enables the echoing functions based on flag.  | 
Turn echoing off:
| In[1]:= | 
And then turn it back on:
| In[2]:= | 
Without an flag, ToggleEcho remembers the global state and toggles it:
| In[3]:= | 
| Out[3]= | 
| In[4]:= | 
| Out[4]= | 
Echo statements are useful in debugging:
| In[5]:= | ![]()  | 
| Out[5]= | 
Note that before returning its output, the above function generates a number of Echo statements:

When no longer needed, ToggleEcho spares you from manually removing them:
| In[6]:= | 
| Out[6]= | 
| In[7]:= | 
| Out[7]= | 
Clean up by setting echos on:
| In[8]:= | 
| Out[8]= | 
This work is licensed under a Creative Commons Attribution 4.0 International License