move log related logic into emitter