def emit(self, span_datas):
        """
        :type span_datas: list of :class:
            `~opencensus.trace.span_data.SpanData`
        :param list of opencensus.trace.span_data.SpanData span_datas:
            SpanData tuples to emit
        """
        with open(self.file_name, self.file_mode) as file:
            # convert to the legacy trace json for easier refactoring
            # TODO: refactor this to use the span data directly
            legacy_trace_json = span_data.format_legacy_trace_json(span_datas)
            trace_str = json.dumps(legacy_trace_json)
            file.write(trace_str)
def emit ( self , span_datas ) : with open ( self . file_name , self . file_mode ) as file : legacy_trace_json = span_data . format_legacy_trace_json ( span_datas ) trace_str = json . dumps ( legacy_trace_json ) file . write ( trace_str )
:type span_datas: list of :class:
            `~opencensus.trace.span_data.SpanData`
        :param list of opencensus.trace.span_data.SpanData span_datas:
            SpanData tuples to emit