summaryrefslogtreecommitdiffstats
path: root/git_trace2_event_log.py
diff options
context:
space:
mode:
authorIan Kasprzak <iankaz@google.com>2021-03-05 11:04:49 -0800
committerIan Kasprzak <iankaz@google.com>2021-03-08 17:32:09 +0000
commit835a34bdb911e15e228cb760043d3f737dd56c84 (patch)
tree2152ffa9a3aa2ccb878ca2d92d67775a36de555f /git_trace2_event_log.py
parentef99ec07b4687cef0129057b81c0c1ebd21bb640 (diff)
downloadgit-repo-835a34bdb911e15e228cb760043d3f737dd56c84.tar.gz
Log repo.* config variables in git trace2 logger.
Bug: [google internal] b/181758736 Testing: - Unit tests - Verified repo git trace2 logs had expected data Change-Id: I9af8a574377bd91115f085808c1271e9dee16a36 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/299182 Tested-by: Ian Kasprzak <iankaz@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Raman Tenneti <rtenneti@google.com>
Diffstat (limited to 'git_trace2_event_log.py')
-rw-r--r--git_trace2_event_log.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/git_trace2_event_log.py b/git_trace2_event_log.py
index fe34092a..8c33d80b 100644
--- a/git_trace2_event_log.py
+++ b/git_trace2_event_log.py
@@ -132,6 +132,21 @@ class EventLog(object):
132 exit_event['code'] = result 132 exit_event['code'] = result
133 self._log.append(exit_event) 133 self._log.append(exit_event)
134 134
135 def DefParamRepoEvents(self, config):
136 """Append a 'def_param' event for each repo.* config key to the current log.
137
138 Args:
139 config: Repo configuration dictionary
140 """
141 # Only output the repo.* config parameters.
142 repo_config = {k: v for k, v in config.items() if k.startswith('repo.')}
143
144 for param, value in repo_config.items():
145 def_param_event = self._CreateEventDict('def_param')
146 def_param_event['param'] = param
147 def_param_event['value'] = value
148 self._log.append(def_param_event)
149
135 def _GetEventTargetPath(self): 150 def _GetEventTargetPath(self):
136 """Get the 'trace2.eventtarget' path from git configuration. 151 """Get the 'trace2.eventtarget' path from git configuration.
137 152