Mercurial > hg
diff hgdemandimport/tracing.py @ 43306:59338f956109 stable 5.2rc0
merge default into stable for 5.2 release
author | Augie Fackler <augie@google.com> |
---|---|
date | Mon, 21 Oct 2019 11:09:48 -0400 |
parents | 2372284d9457 |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/hgdemandimport/tracing.py Wed Oct 02 12:20:36 2019 -0400 +++ b/hgdemandimport/tracing.py Mon Oct 21 11:09:48 2019 -0400 @@ -14,6 +14,7 @@ _checked = False _session = 'none' + def _isactive(): global _pipe, _session, _checked if _pipe is None: @@ -26,6 +27,7 @@ _session = os.environ.get('HGCATAPULTSESSION', 'none') return True + @contextlib.contextmanager def log(whencefmt, *whenceargs): if not _isactive(): @@ -48,6 +50,7 @@ except IOError: pass + def counter(label, amount, *labelargs): if not _isactive(): return