summaryrefslogtreecommitdiffstats
path: root/repo_trace.py
diff options
context:
space:
mode:
Diffstat (limited to 'repo_trace.py')
-rw-r--r--repo_trace.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/repo_trace.py b/repo_trace.py
index f5bc76d4..7be0c045 100644
--- a/repo_trace.py
+++ b/repo_trace.py
@@ -1,5 +1,3 @@
1# -*- coding:utf-8 -*-
2#
3# Copyright (C) 2008 The Android Open Source Project 1# Copyright (C) 2008 The Android Open Source Project
4# 2#
5# Licensed under the Apache License, Version 2.0 (the "License"); 3# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +17,6 @@
19Activated via `repo --trace ...` or `REPO_TRACE=1 repo ...`. 17Activated via `repo --trace ...` or `REPO_TRACE=1 repo ...`.
20""" 18"""
21 19
22from __future__ import print_function
23import sys 20import sys
24import os 21import os
25 22
@@ -28,13 +25,16 @@ REPO_TRACE = 'REPO_TRACE'
28 25
29_TRACE = os.environ.get(REPO_TRACE) == '1' 26_TRACE = os.environ.get(REPO_TRACE) == '1'
30 27
28
31def IsTrace(): 29def IsTrace():
32 return _TRACE 30 return _TRACE
33 31
32
34def SetTrace(): 33def SetTrace():
35 global _TRACE 34 global _TRACE
36 _TRACE = True 35 _TRACE = True
37 36
37
38def Trace(fmt, *args): 38def Trace(fmt, *args):
39 if IsTrace(): 39 if IsTrace():
40 print(fmt % args, file=sys.stderr) 40 print(fmt % args, file=sys.stderr)