如何从 compileInFn 写入日志消息?

How can I write log messages from compileInFn?

如何从 MapGroupCompiler 中的 compileInFn 写入调试消息? 使用 ContextAwareLogger 我得到一个序列化错误。

(像这样:

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

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

)

我只需要使用 ContextLogging 进行扩展

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

  private val log = new ContextAwareLogger(this.getClass)

  ...