Closed pascaltippelt closed 2 years ago
For such a minor difference instead of using the Nuget package, why not just reference the project with your edit?
Because in my humble opinion returning a string like string s = await client.TerminatedReadAsync(...)
and in the console is unnecessarily repeating.
Agree it's noise but useful noise in my case. I wouldn't just remove it but making it optional, sure. Just commenting it out; reference the project instead of the Nuget package as I suggested in the meantime; i'm mulling an update as it's been a while...
@9swampy - Is there any update on this issue / the project as a whole? I'm interested in making the logging optional as well but not sure how / if to contribute. Looks like you have a version 0.9.0 in pre-release and a 0.9.1 branch made. Please let me know the status of this project. Thanks!
@9swampy, thanks for this toolset - really helpful. I would just add a vote that the console output be set up as optional with a method overload or client property, whatever. You seem open to the approach, is this pull request okay or are you looking for another approach to be submitted? For anyone else needing a workaround for the NuGet package, you can do something like this: var StandardOutput = Console.Out; // for reassignment after redirect Console.SetOut(TextWriter.Null); // redirect to null string ResponseMessage = await client.TerminatedReasAsync(ETX, TimeSpan.FromMilliseconds(5000)); // quiet response Console.SetOut(StandardOutput); // reassign stdout Console.WriteLine($"Received this much stuff: {ResponseMessage.Length}"); // or whatever you want..
Didn't merge but the intent's included in the release 0.9.1 I've just pushed to Nuget.
Client.IsConsoleWrite = false; should do it.
Any problems, shout.
As explained in https://github.com/9swampy/Telnet/issues/63