How can I write log messages from compileInFn?

112 Views Asked by At

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)
...
}

)

1

There are 1 best solutions below

0
On BEST ANSWER

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)

  ...