-
-
Notifications
You must be signed in to change notification settings - Fork 960
Refactor logging to allow a loggerfactory per session #1673
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
Conversation
…e ConnectionInfo. This commit introduces an `ILoggerFactory` to various classes, replacing the static logger factory with an instance-based approach for more flexible and session-specific logging. These changes improve the logging framework's flexibility and maintainability and allow unit testing of logging.
ah and unfortunately a lot of the mocking tests are "strict" in that they expect every interface call to be declared. I think you can do whatever is easiest to get them working i.e. remove the strictness if it helps |
Removing the strictness and working around the null return would require a lot of ?? code in the library. So for now i chose the setup the logger everywhere. This create a lot of additions to the unit test, but I think this is the cleanest solution for now. |
4e8ca98
to
aede984
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aede984
to
4963ba9
Compare
LGTM. I wrote a test case for this in a separate branch, but I'm not sure it's worth adding since it requires yet another dependency (test-only though). I would leave this up to @Rob-Hague . This imho makes SshNetLoggingConfiguration kind of obselete, but marking it obsolete after just introducing it doesn't seem sensible. 😄 |
That's a nice test to validate this change. I imagine it is less useful going forward (although perhaps moreso than some other tests...) |
Refactor logging to allow a loggerfactory per session specified in the ConnectionInfo.
This commit introduces an
ILoggerFactory
to various classes, replacing the static logger factory with an instance-based approach for more flexible and session-specific logging. These changes improve the logging framework's flexibility and maintainability and allow unit testing of logging.