Improve DEBUG detection
@@ -67,7 +67,7 @@ public abstract class InvocableElement<I extends InvocableStreamPipesEntity, D e
try {
I graph = Transformer.fromJsonLd(clazz, payload);
- if (System.getenv("SP_DEBUG").equals("true")) {
+ if (isDebug()) {
graph = createGroundingDebugInformation(graph);
}
@@ -151,5 +151,9 @@ public abstract class InvocableElement<I extends InvocableStreamPipesEntity, D e
protected abstract P getExtractor(I graph);
protected abstract I createGroundingDebugInformation(I graph);
+
+ private Boolean isDebug() {
+ return "true".equals(System.getenv("SP_DEBUG"));
+ }
}
