| 48 | good = _global_log.good |
| 49 | |
| 50 | def set_threshold(level, force=False): |
| 51 | prev_level = _global_log.threshold |
| 52 | if prev_level > DEBUG or force: |
| 53 | # If we're running at DEBUG, don't change the threshold, as there's |
| 54 | # likely a good reason why we're running at this level. |
| 55 | _global_log.threshold = level |
| 56 | if level <= DEBUG: |
| 57 | info('set_threshold: setting threshold to DEBUG level,' |
| 58 | ' it can be changed only with force argument') |
| 59 | else: |
| 60 | info('set_threshold: not changing threshold from DEBUG level' |
| 61 | ' %s to %s' % (prev_level, level)) |
| 62 | return prev_level |
| 63 | |
| 64 | def get_threshold(): |
| 65 | return _global_log.threshold |