From b6b574e2ff217e29e573789f73972b4bfb69be52 Mon Sep 17 00:00:00 2001 From: Dmytro Anokhin <5136301+dmytro-anokhin@users.noreply.github.com> Date: Thu, 22 Oct 2020 03:31:32 +0200 Subject: [PATCH] Using log in FileIndex --- Dependencies/Sources/FileIndex/FileIndex.swift | 7 +++++-- Package.swift | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dependencies/Sources/FileIndex/FileIndex.swift b/Dependencies/Sources/FileIndex/FileIndex.swift index 45964cc..4239b56 100644 --- a/Dependencies/Sources/FileIndex/FileIndex.swift +++ b/Dependencies/Sources/FileIndex/FileIndex.swift @@ -8,6 +8,7 @@ import Foundation import CoreData import PlainDatabase +import Log @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) @@ -66,9 +67,11 @@ public class FileIndex { public let configuration: Configuration public init(configuration: Configuration) { - self.configuration = configuration + defer { + log_debug(self, #function, "FileIndex path: \(configuration.directoryURL.path)") + } - print("FileIndex directory: \(configuration.directoryURL.path)") + self.configuration = configuration // Create directories if necessary. Directory must be created before initializing index or adding files. try? FileManager.default.createDirectory(at: configuration.filesDirectoryURL, withIntermediateDirectories: true, attributes: nil) diff --git a/Package.swift b/Package.swift index 96ea0fe..144215f 100644 --- a/Package.swift +++ b/Package.swift @@ -34,7 +34,7 @@ let package = Package( path: "Dependencies/Sources/ImageDecoder"), .target( name: "FileIndex", - dependencies: [ "PlainDatabase" ], + dependencies: [ "PlainDatabase", "Log" ], path: "Dependencies/Sources/FileIndex"), .target( name: "PlainDatabase",