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

Add swift-log #9

Merged
merged 18 commits into from
Apr 13, 2024
Merged

Add swift-log #9

merged 18 commits into from
Apr 13, 2024

Conversation

MasterJ93
Copy link
Owner

@MasterJ93 MasterJ93 commented Apr 5, 2024

Description

This pull request adds logging functionality to ATProtoKit. This uses SwiftLog which will bootstrap OSLog and will determine if it should be used or not depending on whether the platform can import os. This pull request will be complete upon the following tasks and will be in phases:
Phase 1:

  • Bootstrap OSLog
  • Add parameters on ATProtoKitConfiguration-conforming classes for anything related to logging.

Phase 2:

  • Add logs to the following:
    • CoreAPI
    • PlatformAPI
    • APIClentService

Phase 3:

  • Add logs to the following:
    • ATDataStreamConfiguration
    • DateFormatting
    • ATFacetParser
    • ATImageProcessing
    • Data models
    • Any remaining places that need logs

Linked Issues

Link any related issues here. Format: #[issue number]
#7

Type of Change

  • Bug Fix
  • New Feature
  • Documentation

Checklist:

  • My code follows the ATProtoKit API Design Guidelines as well as the Swift API Design Guidelines.
  • I have performed a self-review of my own code and commented it, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings or errors in the compiler or runtime.
  • My code is able to build and run on my machine.

Screenshots (if applicable)

N/A

Additional Notes

When this is completed, issue #7 will close.

Credits

If you want to be credited in the CONTRIBUTORS file, you can fill out the form below. Please don't remove the square brackets.

@MasterJ93 MasterJ93 added the new feature New feature or request label Apr 5, 2024
@MasterJ93 MasterJ93 self-assigned this Apr 5, 2024
@MasterJ93 MasterJ93 added the help wanted Extra attention is needed label Apr 5, 2024
- Moved start method for bottstrapping into a new file.
- Aligned Logger to the log levels.
This is for if the API user doesn't add the bundle identifier
of the project.
This code isn't working, so it'll be commented out until
a better solution arrives. For now, a Swift package already
works, but the ideal thing is to have one less dependency
from logs (using `SwiftLog`, however, is unavoidable).
Trying to add the LoggingOSLog works. However,
this Swift package, for whatever reason, is refusing to
see the LoggingOSLog package. For now, the files and
licence will be added directly into the project until
a different solution appears.
Also fixed a documentation issue in AtprotoLabelDefinition.
Also added documentation for an example.
LoggingOSLog doesn't see to be working and its making
SwiftLog crash. An in-house solution will be used
instead.
@MasterJ93 MasterJ93 marked this pull request as ready for review April 13, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant