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
The current implementation of ATProtoKit lacks a centralized logging mechanism, leading to several challenges, namely that debugging is much more difficult to deal with.
To solve this, SwiftLog will be integrated into the package. Furthermore, two logging backend implementations will be used: one that maps to Apple's unified Logger framework (for Apple platforms) and one that maps to the standard SwiftLog logger.
To be more specific, log events for the methods should be added as appropriate. As an example, take a look at applyWrites():
Various places within the method can have log events, including:
Within the first guard statement's else block, stating that session or accessToken doesn't have a value.
After the guard statement which would show the value of accessToken (albeit, obfuscated).
Within the second guard statement's else block, stating that there's an invalid request URL, followed by a String(describing:) of the request URL.
After the guard statement, which would show the value of requestURL.
After requestBody, which would show the values of requestBody.
After request, which would show the value of request.
After the try await code, which would say that the request has been successful.
Within the catch block, which gives an error log, followed by displaying the error itself.
This issue will focus on implementing log events to the ATProtoKit, ATProtoTools, and ATProtoAdmin classes. Future updates will deal with the remaining parts of the Swift package.
Considered Alternatives
No response
Is this a breaking change?
Yes
Additional Context
Implement log events on all parts of the ATProtoKit class.
Implement log events on all parts of the ATProtoAdmin class.
Implement log events on all parts of the ATProtoTools class.
The text was updated successfully, but these errors were encountered:
MasterJ93
added
enhancement
An enhancement to an existing feature.
draft
This issue is simply a draft and should not be considered until it's complete
labels
May 15, 2024
Summary
No response
Pain points
The current implementation of ATProtoKit lacks a centralized logging mechanism, leading to several challenges, namely that debugging is much more difficult to deal with.
To solve this,
SwiftLog
will be integrated into the package. Furthermore, two logging backend implementations will be used: one that maps to Apple's unifiedLogger
framework (for Apple platforms) and one that maps to the standardSwiftLog
logger.To be more specific, log events for the methods should be added as appropriate. As an example, take a look at
applyWrites()
:Various places within the method can have log events, including:
guard
statement'selse
block, stating thatsession
oraccessToken
doesn't have a value.guard
statement which would show the value ofaccessToken
(albeit, obfuscated).guard
statement'selse
block, stating that there's an invalid request URL, followed by aString(describing:)
of the request URL.guard
statement, which would show the value ofrequestURL
.requestBody
, which would show the values ofrequestBody
.request
, which would show the value ofrequest
.try await
code, which would say that the request has been successful.catch
block, which gives an error log, followed by displaying the error itself.This issue will focus on implementing log events to the
ATProtoKit
,ATProtoTools
, andATProtoAdmin
classes. Future updates will deal with the remaining parts of the Swift package.Considered Alternatives
No response
Is this a breaking change?
Yes
Additional Context
ATProtoKit
class.ATProtoAdmin
class.ATProtoTools
class.The text was updated successfully, but these errors were encountered: