Skip to content
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

[Feature Request]: Replace print function with Logger #7

Closed
KC-2001MS opened this issue Mar 29, 2024 · 5 comments
Closed

[Feature Request]: Replace print function with Logger #7

KC-2001MS opened this issue Mar 29, 2024 · 5 comments
Labels
approved This feature is approved and a Pull Request can be made new feature New feature or request

Comments

@KC-2001MS
Copy link
Contributor

Summary

I want to use Logger to open the line where the log occurred in Xcode.

Pain points

I would like to switch from using the print function to using Logger in order to debug my project more efficiently.
As shown in the following session, the combination of Xcode15 and Logger allows for easier debugging.
https://developer.apple.com/wwdc23/10226
I am also currently adding an Extension to this Logger in the forked repository.
I have not done this because trying to replace all print statements would require changing a few more files. Definitions only.

Considered Alternatives

Compared to the print function used in debugging, this function is superior in that it can easily transition to the part in question.

Is this a breaking change?

No

Library Examples

No response

Additional Context

No response

@KC-2001MS KC-2001MS added the new feature New feature or request label Mar 29, 2024
@MasterJ93
Copy link
Owner

MasterJ93 commented Mar 29, 2024

Thanks for your suggestion. I'm going to be using swift-log for logging purposes. However, I do believe that using print() everywhere isn't ideal. This was only temporary while I was busy making converting all of the lexicons into models and methods. Now that I've completed most of them, I'll look into adding swift-log, as well as your suggestion, in the next couple of weeks. While it may seem unnecessary to add two loggers, the reason is because, to my knowledge, OSLog doesn't work anywhere other than Apple's platforms, and this project aims to be compatible with Linux as well as Apple's platforms. So a solution is needed to do that. My apologies that it'll take some time.

@KC-2001MS
Copy link
Contributor Author

You're right, I was missing the thought about Log on non-Apple platforms.
Adding that requirement, swift-log might be a better fit.
Also, I'd like to build a social networking app, and I'd like to help complete this framework as much as possible. I may do a pull request, but I apologize in advance for my lack of experience with open source contributions.

@MasterJ93
Copy link
Owner

MasterJ93 commented Mar 31, 2024

I am still going to implement your suggestion. I've come up with a potential solution to this by combining both OSLog and swift-log into one class, thereby making it easy for developers to choose one or the other. So I will be doing that.

As for pull requests, I am okay with that as well.

@MasterJ93 MasterJ93 added the approved This feature is approved and a Pull Request can be made label Apr 1, 2024
@MasterJ93 MasterJ93 mentioned this issue Apr 5, 2024
21 tasks
@MasterJ93
Copy link
Owner

The underlying parts of the logging have been completed. I'll be adding the logs over to the other files over time. Thanks again for the suggestion. I apologize for not doing much in the project until now, I've been extremely busy with other things.

The pull request reopen and close over time until all of the places that need logs have been successfully added.

@KC-2001MS
Copy link
Contributor Author

I was too busy to reply here as well. My apologies.
Thank you for your response. Don't be in too much of a hurry, it's inevitable that there will be glitches before release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This feature is approved and a Pull Request can be made new feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants