From: Claudio Cambra Date: Tue, 14 Mar 2023 20:02:25 +0000 (+0100) Subject: Add a logger extensions to use system unified logging in File Provider components X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~10^2~55^2~103 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0f6ceef06f223ebc6922ab636deae0a190d59242;p=nextcloud-desktop.git Add a logger extensions to use system unified logging in File Provider components Signed-off-by: Claudio Cambra --- diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Logger+Extensions.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Logger+Extensions.swift new file mode 100644 index 000000000..971194928 --- /dev/null +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/Logger+Extensions.swift @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2023 by Claudio Cambra + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +import OSLog + +extension Logger { + private static var subsystem = Bundle.main.bundleIdentifier! + + static let desktopClientConnection = Logger(subsystem: subsystem, category: "desktopclientconnection") + static let enumeration = Logger(subsystem: subsystem, category: "enumeration") + static let fileProviderExtension = Logger(subsystem: subsystem, category: "fileproviderextension") + static let fileTransfer = Logger(subsystem: subsystem, category: "filetransfer") + static let localFileOps = Logger(subsystem: subsystem, category: "localfileoperations") + static let ncFilesDatabase = Logger(subsystem: subsystem, category: "nextcloudfilesdatabase") + static let materialisedFileHandling = Logger(subsystem: subsystem, category: "materialisedfilehandling") +} diff --git a/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj index a84a16e00..cff0cef04 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj +++ b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 5318AD9729BF493600CBB71C /* FileProviderMaterialisedEnumerationObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5318AD9629BF493600CBB71C /* FileProviderMaterialisedEnumerationObserver.swift */; }; 5318AD9929BF58D000CBB71C /* NKError+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5318AD9829BF58D000CBB71C /* NKError+Extensions.swift */; }; 5352E85B29B7BFE6002CE85C /* Progress+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5352E85A29B7BFE6002CE85C /* Progress+Extensions.swift */; }; + 535AE30E29C0A2CC0042A9BA /* Logger+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535AE30D29C0A2CC0042A9BA /* Logger+Extensions.swift */; }; 536EFBF7295CF58100F4CB13 /* FileProviderSocketLineProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 536EFBF6295CF58100F4CB13 /* FileProviderSocketLineProcessor.swift */; }; 536EFC36295E3C1100F4CB13 /* NextcloudAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 536EFC35295E3C1100F4CB13 /* NextcloudAccount.swift */; }; 538E396A27F4765000FA63D5 /* UniformTypeIdentifiers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 538E396927F4765000FA63D5 /* UniformTypeIdentifiers.framework */; }; @@ -141,6 +142,7 @@ 5318AD9629BF493600CBB71C /* FileProviderMaterialisedEnumerationObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderMaterialisedEnumerationObserver.swift; sourceTree = ""; }; 5318AD9829BF58D000CBB71C /* NKError+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NKError+Extensions.swift"; sourceTree = ""; }; 5352E85A29B7BFE6002CE85C /* Progress+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Progress+Extensions.swift"; sourceTree = ""; }; + 535AE30D29C0A2CC0042A9BA /* Logger+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Logger+Extensions.swift"; sourceTree = ""; }; 536EFBF6295CF58100F4CB13 /* FileProviderSocketLineProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderSocketLineProcessor.swift; sourceTree = ""; }; 536EFC35295E3C1100F4CB13 /* NextcloudAccount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NextcloudAccount.swift; sourceTree = ""; }; 538E396727F4765000FA63D5 /* FileProviderExt.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = FileProviderExt.appex; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -227,8 +229,9 @@ 5352E85929B7BFB4002CE85C /* Extensions */ = { isa = PBXGroup; children = ( - 5352E85A29B7BFE6002CE85C /* Progress+Extensions.swift */, + 535AE30D29C0A2CC0042A9BA /* Logger+Extensions.swift */, 5318AD9829BF58D000CBB71C /* NKError+Extensions.swift */, + 5352E85A29B7BFE6002CE85C /* Progress+Extensions.swift */, ); path = Extensions; sourceTree = ""; @@ -566,6 +569,7 @@ 536EFBF7295CF58100F4CB13 /* FileProviderSocketLineProcessor.swift in Sources */, 5318AD9929BF58D000CBB71C /* NKError+Extensions.swift in Sources */, 5318AD9529BF438F00CBB71C /* NextcloudLocalFileMetadataTable.swift in Sources */, + 535AE30E29C0A2CC0042A9BA /* Logger+Extensions.swift in Sources */, 5307A6F229675346001E0C6A /* NextcloudFilesDatabaseManager.swift in Sources */, 53D056312970594F00988392 /* LocalFilesUtils.swift in Sources */, 538E396F27F4765000FA63D5 /* FileProviderItem.swift in Sources */,