A javascript console.log() wrapper
- Include the pump_debug.js file in your HTML file
- Turn the debugger on
- Send messages to the console
<script src="/js/pump_debug.js"></script>
<script>_pump.on();</script>Messages will only log to the console if the debugger is set to 'on'. This is helpful for use in both live and development environments. You don't have to worry too much about forgetting to comment-out console.log() in your code anymore!
You can send formatted messages to the console using one of these handy message methods:
Send a generic blue-colored message to the console.
Send an orange warning message to the console.
Send a red error message to the console.
Sends an unformatted message to the console.
In the tools directory are some Sublime Text snippets created by Sean Rabey that make typing the logging commands even easier. Just copy them to your Packages/User folder.
How to use them:
| Shortcut | Command |
|---|---|
| pi | _pump.info(''); |
| pw | _pump.warn(''); |
| pe | _pump.error(''); |
| pl | _pump.log(''); |