Skip to content

Commit

Permalink
Log the name of the file that is not processed by SUSHI (#1307)
Browse files Browse the repository at this point in the history
* Log the name of the file that is not processed by SUSHI

* Use debug level when logging invalid files

Also inform about this in the info level summary message.
  • Loading branch information
mrinnetmaki authored Jul 24, 2023
1 parent bf9c540 commit 8dc0129
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fhirdefs/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export function loadCustomResources(
resourceJSON = converter.xmlToObj(xml);
} else {
invalidFileCount++;
logger.debug(`File not processed by SUSHI: ${file}`);
continue;
}
} catch (e) {
Expand Down Expand Up @@ -98,8 +99,8 @@ export function loadCustomResources(
if (invalidFileCount > 0) {
logger.info(
invalidFileCount > 1
? `Found ${invalidFileCount} files in input/* resource folders that were neither XML nor JSON. These files were not processed as resources by SUSHI.`
: `Found ${invalidFileCount} file in an input/* resource folder that was neither XML nor JSON. This file was not processed as a resource by SUSHI.`
? `Found ${invalidFileCount} files in input/* resource folders that were neither XML nor JSON. These files were not processed as resources by SUSHI. To see the unprocessed files in the logs, run SUSHI with the "--log-level debug" flag.`
: `Found ${invalidFileCount} file in an input/* resource folder that was neither XML nor JSON. This file was not processed as a resource by SUSHI. To see the unprocessed file in the logs, run SUSHI with the "--log-level debug" flag.`
);
}
}
Expand Down

0 comments on commit 8dc0129

Please sign in to comment.