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

[ISSUE] Writing error messages directly to Console is bad form #136

Open
DrEsteban opened this issue May 12, 2024 · 0 comments
Open

[ISSUE] Writing error messages directly to Console is bad form #136

DrEsteban opened this issue May 12, 2024 · 0 comments

Comments

@DrEsteban
Copy link

DrEsteban commented May 12, 2024

Issue Type

  • Support Issue

Describe the issue

default:
var message = $"Unsupported Event: {eventType}\n{body}";
Console.WriteLine(message);
Debug.WriteLine(message);
break;

The package follows a pattern of directly writing to Console when errors occur. This is highly undesirable, especially for those who are writing console-based apps and would like to handle that experience differently.

To Reproduce
Steps to reproduce the behavior:

  1. Write a console app with an intentional UX
  2. Make an error happen on the OBS connection
  3. See the error message directly interrupt the UX

Expected behavior
The library should provide an ILogger-based way of handling error logs. This improves UX concerns, as well as makes error messages actually useful for users, as they now have an opportunity to intercept them in-code.

Screenshots
N/A

Versions
Latest, as of 5/21/2024

Additional context

I'm programmatically creating some input sources using this library, which results in Unsupported Event: InputSettingsChanged <payload> being written to console with no way to disable it... This is extremely frustrating as I'm writing a console app and it's polluting my output. As a general best practice, libraries should NEVER blindly write to the Console - that's the whole reason the ILogger<> abstraction exists.

Worse yet, the library doesn't even provide a mechanism to allow consumers to implement/handle "unsupported events" themselves. So there's literally no way for me to prevent this output from happening, despite the fact it's a "supported scenario" in the library. (Creating input sources programmatically.)

@DrEsteban DrEsteban changed the title Writing error messages to directly Console is bad form [ISSUE] Writing error messages to directly Console is bad form May 12, 2024
@DrEsteban DrEsteban changed the title [ISSUE] Writing error messages to directly Console is bad form [ISSUE] Writing error messages directly to Console is bad form May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant