diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-25 16:43:49 -0400 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-25 16:43:49 -0400 |
| commit | 15f231a79320cbc97cd88d8a4751515a47ce223e (patch) | |
| tree | b86b202cadc816a5da7b96372b9de4362da88116 /common.py | |
| parent | 2ceaa6c607ef85bde4f14017634d9d1621efca29 (diff) | |
Bug fixes from testing.
Diffstat (limited to 'common.py')
| -rw-r--r-- | common.py | 9 |
1 files changed, 6 insertions, 3 deletions
| @@ -200,13 +200,16 @@ def set_logged_list(logged): | |||
| 200 | global __logged | 200 | global __logged |
| 201 | __logged = logged | 201 | __logged = logged |
| 202 | 202 | ||
| 203 | def log_once(id, msg = None, indent = True): | 203 | def log_once(id, msg = None): |
| 204 | global __logged | 204 | global __logged |
| 205 | 205 | ||
| 206 | msg = msg if msg else id | 206 | # Indent if a multithreaded list was specified |
| 207 | indent = type(__logged) != type([]) | ||
| 208 | |||
| 209 | msg = msg.strip('\n') if msg else id | ||
| 207 | 210 | ||
| 208 | if id not in __logged: | 211 | if id not in __logged: |
| 209 | __logged += [id] | 212 | __logged += [id] |
| 210 | if indent: | 213 | if indent: |
| 211 | msg = ' ' + msg.strip('\t').replace('\n', '\n\t') | 214 | msg = ' ' + msg.strip('\t').replace('\n', '\n\t') |
| 212 | sys.stderr.write('\n' + msg.strip('\n') + '\n') | 215 | sys.stderr.write('\n' + msg + '\n') |
