Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove console.log in src/ #3

Closed
elsehow opened this issue Dec 16, 2016 · 5 comments
Closed

Remove console.log in src/ #3

elsehow opened this issue Dec 16, 2016 · 5 comments

Comments

@elsehow
Copy link
Owner

elsehow commented Dec 16, 2016

There are a few places where we console.log informative messages, resulting in a console with messages like:

New remote ephemeral key
Duplicate PreKeyMessage for session
Duplicate PreKeyMessage for session

I think each of these messages should get emitted over some emitter returned by the highest-level entity that makes sense (sessionCiphers come to mind).

@elsehow elsehow changed the title Removed log messages in src/ Remove log messages in src/ Dec 17, 2016
@elsehow elsehow changed the title Remove log messages in src/ Remove console.log in src/ Dec 17, 2016
@derhuerst
Copy link

The debug module might also work.

@elsehow
Copy link
Owner Author

elsehow commented Dec 17, 2016

@derhuerst That could be good!

I am not sure yet which of these messages the caller might care about or want to work with programmatically, and which of these messages are, "everything is working fine, FYI!"

@derhuerst
Copy link

Theoretically, all the messages that a caller is interested in should be available via returns values, events, or something similar. Console logging a very unintuitive and also inflexible way of getting messages, but certainly necessary in debugging. That's why I propose debug for internal messages that only contain messages related to the inner workings of the module and events/return values/exceptions for all messages interesting to "outsiders".

@elsehow
Copy link
Owner Author

elsehow commented Dec 18, 2016

Sounds good to me. If someone ends up needing a value or event, we can always pass it up as an event later.

As an initial step, I may just go through and comment out all of the console.log statements. The comments can serve as a guide for helpful things to debug.

@elsehow
Copy link
Owner Author

elsehow commented Dec 18, 2016

I commented out all the console.logs in 79f7037 and published v0.0.6

I think I will close this issue for now. If callers end up needing these messages, we can use debug or whatever else makes sense for their usecase 👍

@elsehow elsehow closed this as completed Dec 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants