def testFlowLogging(self):
    flow_urn = None
    for session_id in test_lib.TestFlowHelper("DummyLogFlow",
                                              action_mocks.ActionMock(),
                                              token=self.token,
                                              client_id=self.client_id):
      flow_urn = session_id

    with aff4.FACTORY.Open(flow_urn.Add("Logs"), age=aff4.ALL_TIMES,
                           token=self.token) as log_collection:
      count = 0
      # Can't use len with PackedVersionCollection
      for log in log_collection:
        self.assertEqual(log.client_id, self.client_id)
        self.assertTrue(log.log_message in ["First", "Second", "Third",
                                            "Fourth", "Uno", "Dos", "Tres",
                                            "Cuatro"])
        self.assertTrue(log.flow_name in ["DummyLogFlow",
                                          "DummyLogFlowChild"])
        self.assertTrue(str(flow_urn) in str(log.urn))
        count += 1
      self.assertEqual(count, 8)
Check that flows log correctly.
dataset/ETHPy150Open google/grr/grr/lib/flow_test.py/FlowCreationTest.testFlowLogging