Skip to content

Commit

Permalink
style: log format
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Jan 4, 2023
1 parent 2ff6272 commit ab76c46
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/query_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ module.exports = class QueryGraphHandler {
const schemProps = this.schema?.components?.schemas?.QNode?.properties ? this.schema.components.schemas.QNode.properties : {};
const nodeProperties = new Set(Object.keys(schemProps));
const badProperties = new Set();
const badNodes = new Set();
for (const nodeID in queryGraph.nodes) {
for (const property in queryGraph.nodes[nodeID]) {
if (!nodeProperties.has(property)) {
badProperties.add(property);
badNodes.add(nodeID);
}
}
}
Expand All @@ -111,7 +113,7 @@ module.exports = class QueryGraphHandler {
new LogEntry(
'WARNING',
null,
`Encountered one or more properties on a QNode that we don't recognize: ${Array.from(badProperties).join(',')}. Properties will be ignored.`,
`Ignoring unrecognized properties (${[...badProperties].join(',')}) on nodes (${[...badNodes].join(',')}).`,
).getLog()
);
}
Expand All @@ -121,10 +123,12 @@ module.exports = class QueryGraphHandler {
const schemProps = this.schema?.components?.schemas?.QEdge?.properties ? this.schema.components.schemas.QEdge.properties : {};
const edgeProperties = new Set(Object.keys(schemProps));
const badProperties = new Set();
const badEdges = new Set();
for (const edgeID in queryGraph.edges) {
for (const property in queryGraph.edges[edgeID]) {
if (!edgeProperties.has(property)) {
badProperties.add(property);
badEdges.add(edgeID);
}
}
}
Expand All @@ -134,7 +138,7 @@ module.exports = class QueryGraphHandler {
new LogEntry(
'WARNING',
null,
`Encountered one or more properties on a QEdge that we don't recognize: ${Array.from(badProperties).join(',')}. Properties will be ignored.`,
`Ignoring unrecognized properties (${[...badProperties].join(',')}) on edges (${[...badEdges].join(',')}).`,
).getLog()
);
}
Expand Down

0 comments on commit ab76c46

Please sign in to comment.