diff --git a/java/src/com/google/template/soy/jbcsrc/api/SoySauce.java b/java/src/com/google/template/soy/jbcsrc/api/SoySauce.java index 5e26851a73..27b1ba951c 100644 --- a/java/src/com/google/template/soy/jbcsrc/api/SoySauce.java +++ b/java/src/com/google/template/soy/jbcsrc/api/SoySauce.java @@ -23,6 +23,7 @@ import com.google.common.collect.ImmutableSet; import com.google.errorprone.annotations.CanIgnoreReturnValue; import com.google.errorprone.annotations.CheckReturnValue; +import com.google.template.soy.data.LoggingAdvisingAppendable; import com.google.template.soy.data.SanitizedContent; import com.google.template.soy.data.SanitizedContent.ContentKind; import com.google.template.soy.data.SoyInjector; @@ -225,6 +226,19 @@ default WriteContinuation renderHtml(Appendable out) throws IOException { return renderHtml(asAdvisingAppendable(out)); } + /** + * Renders the configured html template to the given appendable, returning a continuation. If + * captureLogs is true, logs are writtent to the {@link LoggingAdvisingAppendable}. + * + *
Verifies that the content type is {@link ContentKind.HTML} (corresponding to kind="html" + * in the template). + * + *
See {@link #renderHtml(AdvisingAppendable out)} for more details).
+ */
+ @CheckReturnValue
+ WriteContinuation renderHtml(LoggingAdvisingAppendable out, boolean captureLogs)
+ throws IOException;
+
/**
* Renders the configured html template to a {@link SanitizedContent}. Verifies that the content
* type is {@link ContentKind.HTML} (corresponding to kind="html" in the template).
diff --git a/java/src/com/google/template/soy/jbcsrc/api/SoySauceImpl.java b/java/src/com/google/template/soy/jbcsrc/api/SoySauceImpl.java
index a897a6b6b2..c7e1534b31 100644
--- a/java/src/com/google/template/soy/jbcsrc/api/SoySauceImpl.java
+++ b/java/src/com/google/template/soy/jbcsrc/api/SoySauceImpl.java
@@ -28,6 +28,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSortedSet;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
+import com.google.template.soy.data.LoggingAdvisingAppendable;
import com.google.template.soy.data.RecordProperty;
import com.google.template.soy.data.SanitizedContent;
import com.google.template.soy.data.SanitizedContent.ContentKind;
@@ -278,6 +279,12 @@ public WriteContinuation renderHtml(AdvisingAppendable out) throws IOException {
return startRender(out, ContentKind.HTML);
}
+ @Override
+ public WriteContinuation renderHtml(LoggingAdvisingAppendable out, boolean captureLogs)
+ throws IOException {
+ return startRender(out, ContentKind.HTML, captureLogs);
+ }
+
@Override
public Continuation