Short Description of the Feature
Add an optional debug mode that logs detailed information to the browser console, including initialization steps, state changes, storage operations, and any errors or warnings. Debug mode is disabled by default.
Expected Benefits
- Greatly simplifies troubleshooting for developers integrating the plugin
- Reduces support burden (users can enable debug and share logs)
- Helps identify edge cases and bugs during development
- Provides transparency about plugin behavior
- Standard practice for professional open-source libraries
Acceptance Criteria
Documentation
Enabling debug mode:
bsDarkmodeToggle({
debug: true,
storage: "local"
});
<div data-plugin="bs-darkmode-toggle" data-debug></div>
Additional Comments
Implementation should use a simple log(message, level) method that checks this.options.debug before outputting. Consider using console.group() for complex operations to improve readability.
Feature Request Checklist
Short Description of the Feature
Add an optional
debugmode that logs detailed information to the browser console, including initialization steps, state changes, storage operations, and any errors or warnings. Debug mode is disabled by default.Expected Benefits
Acceptance Criteria
debug: booleanoption (default:false)debug: true, all internal operations are logged with consistent prefix:[DarkModeToggle]Documentation
Enabling debug mode:
Additional Comments
Implementation should use a simple
log(message, level)method that checks this.options.debug before outputting. Consider usingconsole.group()for complex operations to improve readability.Feature Request Checklist