mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-21 20:45:51 +03:00
Directly provide text file path to logger for debug archive creation
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
b2e5659c43
commit
571b1ca238
3 changed files with 8 additions and 7 deletions
|
@ -50,9 +50,10 @@ extension Logger {
|
|||
}
|
||||
|
||||
@available(macOSApplicationExtension 12.0, *)
|
||||
static func createDebugArchive(saveFolderUrl: URL) {
|
||||
let saveFileUrl = saveFolderUrl.appendingPathComponent("nc-fileprovider-debug.txt")
|
||||
let saveFilePath = saveFolderUrl.path
|
||||
static func createDebugArchive(saveFileURL: URL) {
|
||||
let saveFilePath = saveFileURL.path
|
||||
|
||||
Logger.logger.info("Creating debug file at path \(saveFilePath, privacy: .public)")
|
||||
|
||||
guard FileManager.default.createFile(atPath: saveFilePath, contents: nil) else {
|
||||
Logger.logger.error("Could not create log file")
|
||||
|
@ -65,7 +66,7 @@ extension Logger {
|
|||
}
|
||||
|
||||
for logString in logs {
|
||||
try? logString.write(to: saveFileUrl, atomically: true, encoding: .utf8)
|
||||
try? logString.write(to: saveFileURL, atomically: true, encoding: .utf8)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ class ClientCommunicationService: NSObject, NSFileProviderServiceSource, NSXPCLi
|
|||
|
||||
func createDebugArchive(at url: URL!) {
|
||||
if #available(macOSApplicationExtension 12.0, *) {
|
||||
Logger.createDebugArchive(saveFolderUrl: url)
|
||||
Logger.createDebugArchive(saveFileURL: url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -409,8 +409,8 @@ void FileProviderSettingsController::createDebugArchive(const QString &userIdAtH
|
|||
{
|
||||
const auto filename = QFileDialog::getSaveFileName(nullptr,
|
||||
tr("Create Debug Archive"),
|
||||
{},
|
||||
tr("Zip Archives") + " (*.zip)");
|
||||
QStandardPaths::writableLocation(QStandardPaths::StandardLocation::DocumentsLocation),
|
||||
tr("Text files") + " (*.txt)");
|
||||
if (filename.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue