You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2021/09/24 19:13:29 UTC
[plc4x] 02/04: feat: inject tracer into freemarker templates
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit 212818e71a428eced6de2fd35aac71708fa9d217
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Sep 24 20:31:19 2021 +0200
feat: inject tracer into freemarker templates
---
.../codegenerator/protocol/freemarker/FreemarkerLanguageOutput.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/code-generation/language-base-freemarker/src/main/java/org/apache/plc4x/plugins/codegenerator/protocol/freemarker/FreemarkerLanguageOutput.java b/code-generation/language-base-freemarker/src/main/java/org/apache/plc4x/plugins/codegenerator/protocol/freemarker/FreemarkerLanguageOutput.java
index 237798a..a89aa92 100644
--- a/code-generation/language-base-freemarker/src/main/java/org/apache/plc4x/plugins/codegenerator/protocol/freemarker/FreemarkerLanguageOutput.java
+++ b/code-generation/language-base-freemarker/src/main/java/org/apache/plc4x/plugins/codegenerator/protocol/freemarker/FreemarkerLanguageOutput.java
@@ -71,6 +71,7 @@ public abstract class FreemarkerLanguageOutput implements LanguageOutput {
typeContext.put("protocolName", protocolName);
typeContext.put("outputFlavor", outputFlavor);
typeContext.put("helper", getHelper(null, protocolName, outputFlavor, types, options));
+ typeContext.put("tracer", Tracer.start("global"));
typeContext.putAll(options);
for (Template template : specTemplates) {
@@ -92,6 +93,7 @@ public abstract class FreemarkerLanguageOutput implements LanguageOutput {
typeContext.put("typeName", typeEntry.getKey());
typeContext.put("type", typeEntry.getValue());
typeContext.put("helper", getHelper(typeEntry.getValue(), protocolName, outputFlavor, types, options));
+ typeContext.put("tracer", Tracer.start("types"));
// Depending on the type, get the corresponding list of templates.
List<Template> templateList;