You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, AprsIsClient requires an ILogger parameter. This is extremely useful for additional information output (and logging when used in web servers). However, that makes the code slightly more difficult to call for new developers or in situations where a logger is not needed.
To help ease development, we should make the logger parameter to AprsIsClient's constructor optional (nullable, default to null) and do one of the following if the parameter is not supplied:
Set the logger in the client to null and ensure all invocations of it use conditional dereference (e.g. (logger?.LogInformation(...);)
Set a non-null logger of NullLogger class like in the unit tests, then it will log to nowhere
I suspect the first option is probably the best option as a null value clearly indicates the intent of not having a logger.
Acceptance Criteria
Make the logger parameter on AprsIsClient nullable and optional (default to null)
Update code inside the AprsIsClient to handle that as appropriate (see options above)
Update unit tests to simply not specify a logger instead of passing a null logger. Ensure at least one test invokes without and at least one with a logger to ensure both construction methods work
The text was updated successfully, but these errors were encountered:
Description
Currently,
AprsIsClient
requires anILogger
parameter. This is extremely useful for additional information output (and logging when used in web servers). However, that makes the code slightly more difficult to call for new developers or in situations where a logger is not needed.To help ease development, we should make the logger parameter to
AprsIsClient
's constructor optional (nullable, default to null) and do one of the following if the parameter is not supplied:logger?.LogInformation(...);
)NullLogger
class like in the unit tests, then it will log to nowhereI suspect the first option is probably the best option as a null value clearly indicates the intent of not having a logger.
Acceptance Criteria
AprsIsClient
nullable and optional (default to null)AprsIsClient
to handle that as appropriate (see options above)The text was updated successfully, but these errors were encountered: