-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add config option lessVerbose #128
Conversation
Hi @srguiwiz, great change! Thanks for submitting a PR for that. If we have Verbosity.Silent we only want to print if I think that the example will make that clearer: enum Verbosity = {
Silent = 0,
Normal = 1
}
function info(msg: string, verbosity = Verbosity.Normal) {
if (Config.verbosity < verbosity) return;
...
} And then you can only change places when you left Tell me what you think! |
I don't disagree. After reading your comment I had spent a short amount of time thinking of something optimal. But, time can be short in supply. By now I forgot what I had thought. Thinking of future compatibility without spending more time: If you would merge as is, then a future implementation could choose to take a truthy value in lessVerbose and use it in its newer and improved ways. I think, almost sure, but I could be wrong. Btw, the specific style of coding was chosen for minimal diff. Not saying that is always the best choice. It was what I had thought that moment would be the least intrusive. If it had been "my" project I'd probably have chosen different constructs, which the moment I was about the type them I thought they would cause a bigger diff. I would not be offended if you reject this PR and implement it differently. It's all good. Thank you |
Hi @srguiwiz. Sorry for leaving it for so long. I've finally found some time to sit down and make the changes I was talking about. I totally get your point of view of wanting to change as little as possible. It was not necessary to reject the PR itself as your idea and code were good starting point for my improvements, so thank you very much for suggesting this feature and taking your time to implement it. I don't know if you are still interested in it as a long time have passed but I hope so! |
@szymmis, thank you for your thoughtful implementation. And yes, this is still a useful package. |
This is for issue #127 .
When not used, nothing changes compared to previous behavior.
One could think of the function name
infoV
to meaninfoVerbose
.