diskDB
diskDB copied to clipboard
Option to Suppress Console Logs on diskDB.connect()
Feature Request Summary
I think the option to suppress success/error console log messages upon connecting to a collection would be useful. This would be useful in cases where disk DB is implemented in production / command-line applications where you want to suppress these logs (successful or not) from users.
Example of Issue
For example, I use Disk DB in a CLI App I develop, and when the app connects to Disk DB it breaks up the console.log interface that the user interacts with:
? Which template would you like to use? Daily Notes
? What's the file name? (Leave blank to use the template default) :
? Where should the file go? (Leave blank for current directory) :
Generating Note...
Successfully connected to : C:\Users\Mykal\Documents\GitHub\NoteGen\src
Note Generated!
Proposed Solution
I propose adding in an optional object param that contains a named key supressLogs
. The proposed new API would be :+1:
db.connect('path/to/collections', ['myCollection'], {supressLogs: true})
This would then be used in the connect method to determine whether or not console logs should be printed.
Action Items
- [ ] Update connect function to accept optional parameter
- [ ] Update documentation to explain the new parameter
- [ ] Ensure all tests still pass
- [ ] Submit PR & make necessary changes :tada:
I would be more than willing to start work on this right away if you're okay with the change! Thanks for your time reviewing it either way!
I'd love to see this feature implemented! Although I'm using the library with Express, I'd still like to suppress the console messages to keep my console output clean.