Add warnings and errors to output

This commit is contained in:
Christoph Hagen 2022-12-01 14:52:36 +01:00
parent 1ceba25d4f
commit 27b8d5b3ee

View File

@ -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)" }