Shanedell commented on code in PR #875:
URL: https://github.com/apache/daffodil/pull/875#discussion_r1025242502


##########
daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala:
##########
@@ -929,7 +930,7 @@ object Main {
 
             processor = processor.withValidationMode(validate)
 
-            setupDebugOrTrace(processor.asInstanceOf[DataProcessor], conf)
+            val debugProcessor = 
setupDebugOrTrace(processor.asInstanceOf[DataProcessor], conf)

Review Comment:
   So I was able to get it work like this:
   
   ```scala
   val processor: Option[DataProcessor] = {
     if (parseOpts.parser.isDefined) {
       createProcessorFromParser(parseOpts.parser(), parseOpts.path.toOption, 
validate)
     } else {
        val tunables = 
DaffodilTunables.configPlusMoreTunablesMap(parseOpts.tunables, optDafConfig)
         createProcessorFromSchema(parseOpts.schema(), 
parseOpts.rootNS.toOption, parseOpts.path.toOption, tunables, validate)
     }
   }.map{ _.withExternalVariables(combineExternalVariables(parseOpts.vars, 
optDafConfig)) }
    .map{ _.withValidationMode(validate) }
    .map{ proc => withDebugOrTrace(proc.asInstanceOf[DataProcessor], conf) }
   ```
   
   Doing `.map{ withDebugOrTrace(_.asInstanceOf[DataProcessor], conf) }` or 
`.map{ withDebugOrTrace(_, conf) }` caused errors. Is this what would be 
desired or would you want me to add `withDebugger` defintions to 
`DataProcessorBase` trait that you just mentioned?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to