diff options
Diffstat (limited to 'repo_trace.py')
| -rw-r--r-- | repo_trace.py | 6 |
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 @@ | |||
| 19 | Activated via `repo --trace ...` or `REPO_TRACE=1 repo ...`. | 17 | Activated via `repo --trace ...` or `REPO_TRACE=1 repo ...`. |
| 20 | """ | 18 | """ |
| 21 | 19 | ||
| 22 | from __future__ import print_function | ||
| 23 | import sys | 20 | import sys |
| 24 | import os | 21 | import 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 | |||
| 31 | def IsTrace(): | 29 | def IsTrace(): |
| 32 | return _TRACE | 30 | return _TRACE |
| 33 | 31 | ||
| 32 | |||
| 34 | def SetTrace(): | 33 | def SetTrace(): |
| 35 | global _TRACE | 34 | global _TRACE |
| 36 | _TRACE = True | 35 | _TRACE = True |
| 37 | 36 | ||
| 37 | |||
| 38 | def Trace(fmt, *args): | 38 | def Trace(fmt, *args): |
| 39 | if IsTrace(): | 39 | if IsTrace(): |
| 40 | print(fmt % args, file=sys.stderr) | 40 | print(fmt % args, file=sys.stderr) |
