Skip to content

Option to Suppress Console Logs on diskDB.connect() #50

Description

@MykalMachon

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 👍

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 🎉

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions