mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Prefix error events with RepoErrorEvent:
Prior to this change there is no way to distinguish between git sessions logs generated from repo source v.s. from git. Bug: b/294446468 Change-Id: I309f59e146c30cb08a0637e8d0b9c5d9efd5cada Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/381794 Commit-Queue: Jason Chang <jasonnc@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Tested-by: Jason Chang <jasonnc@google.com>
This commit is contained in:
parent
32b59565b7
commit
b8a7b4a629
@ -203,8 +203,8 @@ class EventLog(object):
|
|||||||
error_event = self._CreateEventDict("error")
|
error_event = self._CreateEventDict("error")
|
||||||
if fmt is None:
|
if fmt is None:
|
||||||
fmt = msg
|
fmt = msg
|
||||||
error_event["msg"] = msg
|
error_event["msg"] = f"RepoErrorEvent:{msg}"
|
||||||
error_event["fmt"] = fmt
|
error_event["fmt"] = f"RepoErrorEvent:{fmt}"
|
||||||
self._log.append(error_event)
|
self._log.append(error_event)
|
||||||
|
|
||||||
def _GetEventTargetPath(self):
|
def _GetEventTargetPath(self):
|
||||||
|
@ -338,8 +338,8 @@ class EventLogTestCase(unittest.TestCase):
|
|||||||
# Check for 'error' event specific fields.
|
# Check for 'error' event specific fields.
|
||||||
self.assertIn("msg", error_event)
|
self.assertIn("msg", error_event)
|
||||||
self.assertIn("fmt", error_event)
|
self.assertIn("fmt", error_event)
|
||||||
self.assertEqual(error_event["msg"], msg)
|
self.assertEqual(error_event["msg"], f"RepoErrorEvent:{msg}")
|
||||||
self.assertEqual(error_event["fmt"], fmt)
|
self.assertEqual(error_event["fmt"], f"RepoErrorEvent:{fmt}")
|
||||||
|
|
||||||
def test_write_with_filename(self):
|
def test_write_with_filename(self):
|
||||||
"""Test Write() with a path to a file exits with None."""
|
"""Test Write() with a path to a file exits with None."""
|
||||||
|
Loading…
Reference in New Issue
Block a user