如何从compileInFn中编写日志消息?

时间:2018-05-04 11:42:22

标签: here-olp

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

(像这样:

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

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

1 个答案:

答案 0 :(得分:0)

我只需要使用ContextLogging扩展

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

  private val log = new ContextAwareLogger(this.getClass)

  ...