pleshevskiy / sonic-channel

Rust client for sonic search backend
Mozilla Public License 2.0
41 stars 8 forks source link

Add ability to disable debug logging #6

Closed talzion12 closed 3 years ago

talzion12 commented 3 years ago

It seems that every message on the sonic channel is printed (using dbg!) and there is no way to disable this behavior.

In dbg's documentation it says the following:

Note that the macro is intended as a debugging tool and therefore you should avoid having uses of it in version control for long periods. Use cases involving debug output that should be added to version control are better served by macros such as debug! from the log crate.

I think it may be useful to consider using something like the log crate or maybe adding a feature to disable dbg logging.

pleshevskiy commented 3 years ago

This dbg was originally a temporary debugging mechanism that ended up staying in the main branch. I was already thinking about adding a log, but I'm busy with other things for the next couple of months. I'll accept a PR that will remove dbg from the code. Thanks!