Skip to content

Conversation

@absaroj
Copy link
Contributor

@absaroj absaroj commented May 4, 2023

Adding swift wrapper for logmanager and logger classes over Objc .

@absaroj absaroj requested a review from eduardo-camacho May 6, 2023 00:29
@absaroj absaroj requested a review from mannie May 12, 2023 02:52
//

/// Wrapper class around ObjC Logger class `ODWLogger` used to events.
public class Logger {
Copy link

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.

Copy link
Contributor Author

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.

Copy link

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.

Copy link
Contributor Author

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.

Copy link

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?

@absaroj absaroj requested a review from mannie May 17, 2023 00:43
@ThomsonTan
Copy link
Contributor

There seems some CI failures for iOS build.

@absaroj absaroj requested a review from mannie May 24, 2023 00:17
@lalitb
Copy link
Contributor

lalitb commented May 24, 2023

Merging to unblock. iOS build failure is not related to this PR.

@lalitb lalitb merged commit 90020d5 into main May 24, 2023
@lalitb lalitb deleted the absaroj/add_mgr_logger branch May 24, 2023 02:29
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

Successfully merging this pull request may close these issues.

6 participants