From 27b8d5b3ee006d992f8eeae1c92456fb3ecb219f Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Thu, 1 Dec 2022 14:52:36 +0100 Subject: [PATCH] Add warnings and errors to output --- Sources/Generator/Processing/MetadataInfoLogger.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/Generator/Processing/MetadataInfoLogger.swift b/Sources/Generator/Processing/MetadataInfoLogger.swift index 4baedc3..2400f57 100644 --- a/Sources/Generator/Processing/MetadataInfoLogger.swift +++ b/Sources/Generator/Processing/MetadataInfoLogger.swift @@ -129,6 +129,8 @@ final class MetadataInfoLogger { func printMetadataScanOverview() { print(" Number of pages: \(numberOfMetadataFiles)") + print(" Warnings: \(warnings.count)") + print(" Errors: \(errors.count)") print(" Unreadable files: \(unreadableMetadata.count)") print(" Unused properties: \(unusedProperties.count)") print(" Invalid properties: \(invalidProperties.count)") @@ -138,7 +140,9 @@ final class MetadataInfoLogger { func writeResultsToFile(in folder: URL) throws { let url = folder.appendingPathComponent("Metadata issues.txt") - var lines = ["Unreadable files:"] + unreadableMetadata.map { "\($0.source): \($0.error)" } + var lines = ["Errors:"] + errors.map { "\($0.source): \($0.message)" } + lines += ["Warnings:"] + warnings.map { "\($0.source): \($0.message)" } + lines += ["Unreadable files:"] + unreadableMetadata.map { "\($0.source): \($0.error)" } lines += ["Unused properties:"] + unusedProperties.map { "\($0.source): \($0.name)" } lines += ["Invalid properties:"] + invalidProperties.map { "\($0.source): \($0.name) (\($0.reason))" } lines += ["Unknown properties:"] + unknownProperties.map { "\($0.source): \($0.name)" }