console-log package
console-log is a simple and smart helper function that makes logging and debugging easy. New Config options added
Features (click for demo)
Basic Logging
ctrl-l
(OSX) orctrl-alt-l
(Linux/Windows) - Generates a console.log with identifier if text/variable is selected, and empty console.log if no text is selected.ctrl-o
(OSX) orctrl-alt-o
(Linux/Windows) - Generates a console.log with text/variable within a JSON.stringify method.
Smart Object Logging (Incremental improvements in works)
Smart Function Logging (Early release still in works)
Smart Conditionals Logging (early release)
Logging Cleanup
Identifier Styling (Chrome Dev Tools only)
Note:- This functionality will only work for selected text
ctrl-alt-c
(plain insert) orctrl-alt-s
(JSON.stringify insert) - For logging in the chrome dev tools console, you can choose to enable text styling for the identifier
Installation
You can install this package from the CLI or from the Editor.
- CLI -
apm install console-log
- Editor -
Atom > Preferences > Install > Search for console-log in Packages
Configurations
- Include semi-colons : Choose whether you want to include semi-colons at end of console.log function. Depending on the linting standard you use, you can choose to include semicolons. Defaults to no semi-colons
- Define Identifier case : Choose whether to retain case of selected text when creating identifier. Defaults to creating an identifier in capital case of selected text
- Include background style for identifier: For logging in the chrome dev tools console, you can choose to enable background styling for the identifier defaults to none
- Include text style for identifier: For logging in the chrome dev tools console, you can choose to enable text styling for the identifier defaults to none
- Include String TEST for identification if no text selected: Rather than include a dumb
console.log()
insert, if you can select to haveconsole.log('TEST')
inserted, which will show up as the code run past it.
Languages Supported
- Javascript
Coming soon !
- Support for single line es6 arrow functions
- code contributions are welcome.
Help me help you !
If you see any bugs in this package or if you have any additional features that you would like, please add an issue to this repo and I will look to resolve it.