here-olp

How can I write log messages from compileInFn?


How can I write debug messages from a compileInFn in a MapGroupCompiler? With the ContextAwareLogger I get a serialization error.

(like this:

class Compiler(context: DriverContext, compilerConf: CompilerConfig)
  extends MapGroupCompiler[IntermediateData]
  with CompileOut1To1Fn[IntermediateData]
  with LayerDefinitions {

private val log = new ContextAwareLogger(this.getClass)
...
}

)


Solution

  • I just had to extend with ContextLogging

    class Compiler(context: DriverContext, compilerConf: CompilerConfig)
      extends MapGroupCompiler[IntermediateData]
      with ContextLogging     // <--
      with CompileOut1To1Fn[IntermediateData]
      with LayerDefinitions {
    
      private val log = new ContextAwareLogger(this.getClass)
    
      ...