-
Notifications
You must be signed in to change notification settings - Fork 58
Adding swift wrapper for logmanager and logger classes over Objc #1143
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
wrappers/swift/Logger.swift
Outdated
| // | ||
|
|
||
| /// Wrapper class around ObjC Logger class `ODWLogger` used to events. | ||
| public class Logger { |
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.
Do we expect subclasses of this class? If not, we should mark this as final to prevent unexpected behaviors if someone chooses to subclass.
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.
Don't see it now but in future it might get subclassed as it has lots of instance methods. So keeping it non-final.
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.
The problem is that these classes don't seem designed for subclassing since they are modifying class properties instead of instance properties. The state management can get pretty complicated.
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.
Not sure if I understand the comment. Can you please explain the class properties vs instance properties? As I see this class is indeed being instantiated and modifying via its instance methods.
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.
While this class is modifying its internal state via instance variables, there isn't a defined contract on how other classes should subclass this. As a subclasser, will I be required to call super at some point in my implementation? Do I do that at the start or at the end of my implementation? If I override on function, do I need to override the others?
|
There seems some CI failures for iOS build. |
|
Merging to unblock. iOS build failure is not related to this PR. |
Adding swift wrapper for logmanager and logger classes over Objc .