def get_log(self, apply_filter=False, identifier=None): messages = [] if apply_filter: for line in self.streamedlogs.get_streamed_log_messages(): messages.append(filter_tahoe_log_message(line, identifier)) else: for line in self.streamedlogs.get_streamed_log_messages(): messages.append(json.dumps(json.loads(line), sort_keys=True)) return '\n'.join(messages)
def test__apply_filter_by_message_type(msg, keys): for key in keys: original_value = str(msg.get(key)) filtered_msg = filter_tahoe_log_message(json.dumps(msg), "1") assert original_value not in filtered_msg