override func prepare(
forAction actionIdentifier: String, itemIdentifiers: [NSFileProviderItemIdentifier]
) {
- Logger.actionViewController.info("Preparing for action: \(actionIdentifier)")
+ Logger.actionViewController.info("Preparing action: \(actionIdentifier, privacy: .public)")
if actionIdentifier == "com.nextcloud.desktopclient.FileProviderUIExt.ShareAction" {
prepare(childViewController: ShareViewController(itemIdentifiers))
}
override func prepare(forError error: Error) {
- Logger.actionViewController.info("Preparing for error: \(error.localizedDescription)")
+ Logger.actionViewController.info(
+ """
+ Preparing for error: \(error.localizedDescription, privacy: .public)
+ """
+ )
}
override public func loadView() {
) { account, share, data, error in
defer { continuation.resume(returning: error) }
guard error == .success else {
- Logger.shareController.error("Error creating link share: \(error)")
+ Logger.shareController.error(
+ """
+ Error creating link share: \(error.errorDescription, privacy: .public)
+ """
+ )
return
}
}
} else {
guard let shareWith = shareWith else {
let errorString = "No recipient for share!"
- Logger.shareController.error("\(errorString)")
+ Logger.shareController.error("\(errorString, privacy: .public)")
let error = NKError(statusCode: 0, fallbackDescription: errorString)
continuation.resume(returning: error)
return
) { account, share, data, error in
defer { continuation.resume(returning: error) }
guard error == .success else {
- Logger.shareController.error("Error creating share: \(error)")
+ Logger.shareController.error(
+ """
+ Error creating share: \(error.errorDescription, privacy: .public)
+ """
+ )
return
}
}
attributes: String? = nil,
options: NKRequestOptions = NKRequestOptions()
) async -> NKError? {
- Logger.shareController.info("Saving share: \(self.share.url)")
+ Logger.shareController.info("Saving share: \(self.share.url, privacy: .public)")
return await withCheckedContinuation { continuation in
kit.updateShare(
idShare: share.idShare,
attributes: attributes,
options: options
) { account, share, data, error in
- Logger.shareController.info("Received update response: \(share?.url ?? "")")
+ Logger.shareController.info(
+ """
+ Received update response: \(share?.url ?? "", privacy: .public)
+ """
+ )
defer { continuation.resume(returning: error) }
guard error == .success, let share = share else {
- Logger.shareController.error("Error updating save: \(error.errorDescription)")
+ Logger.shareController.error(
+ """
+ Error updating save: \(error.errorDescription, privacy: .public)
+ """
+ )
return
}
self.share = share
}
func delete() async -> NKError? {
- Logger.shareController.info("Deleting share: \(self.share.url)")
+ Logger.shareController.info("Deleting share: \(self.share.url, privacy: .public)")
return await withCheckedContinuation { continuation in
kit.deleteShare(idShare: share.idShare) { account, error in
- Logger.shareController.info("Received delete response: \(self.share.url)")
+ Logger.shareController.info(
+ """
+ Received delete response: \(self.share.url, privacy: .public)
+ """
+ )
defer { continuation.resume(returning: error) }
guard error == .success else {
- Logger.shareController.error("Error deleting save: \(error.errorDescription)")
+ Logger.shareController.error(
+ """
+ Error deleting save: \(error.errorDescription, privacy: .public)
+ """
+ )
return
}
}
}
var createMode = false {
didSet {
- Logger.shareOptionsView.info("Create mode set: \(self.createMode)")
+ Logger.shareOptionsView.info("Create mode set: \(self.createMode, privacy: .public)")
shareTypePicker.isHidden = !createMode
shareRecipientTextField.isHidden = !createMode
labelTextField.isHidden = createMode // Cannot set label on create API call
let itemServerRelativePath = dataSource.itemServerRelativePath
else {
Logger.shareOptionsView.error("Cannot create new share due to missing data.")
- Logger.shareOptionsView.error("dataSource: \(self.dataSource)")
- Logger.shareOptionsView.error("kit: \(self.kit)")
+ Logger.shareOptionsView.error("dataSource: \(self.dataSource, privacy: .public)")
+ Logger.shareOptionsView.error("kit: \(self.kit, privacy: .public)")
Logger.shareOptionsView.error(
- "path: \(self.dataSource?.itemServerRelativePath ?? "")"
+ "path: \(self.dataSource?.itemServerRelativePath ?? "", privacy: .public)"
)
return
}
optionsView.dataSource = shareDataSource
} catch let error {
let errorString = "Error processing item: \(error)"
- Logger.shareViewController.error("\(errorString)")
+ Logger.shareViewController.error("\(errorString, privacy: .public)")
fileNameLabel.stringValue = "Unknown item"
descriptionLabel.stringValue = errorString
}
let fileThumbnail = await withCheckedContinuation { continuation in
generator.generateRepresentations(for: request) { thumbnail, type, error in
if thumbnail == nil || error != nil {
- Logger.shareViewController.error("Could not get thumbnail: \(error)")
+ Logger.shareViewController.error(
+ """
+ Could not get thumbnail: \(error, privacy: .public)
+ """
+ )
}
continuation.resume(returning: thumbnail)
}