2010-05-02 00:03:45 +02:00
|
|
|
import sys, os
|
|
|
|
|
2010-05-02 06:52:06 +02:00
|
|
|
logprefix = ''
|
2010-05-02 08:14:20 +02:00
|
|
|
verbose = 0
|
2010-05-02 06:52:06 +02:00
|
|
|
|
2010-05-02 00:03:45 +02:00
|
|
|
def log(s):
|
|
|
|
sys.stdout.flush()
|
2010-05-02 06:52:06 +02:00
|
|
|
sys.stderr.write(logprefix + s)
|
2010-05-02 00:03:45 +02:00
|
|
|
sys.stderr.flush()
|
2010-05-02 08:14:20 +02:00
|
|
|
|
|
|
|
def debug1(s):
|
|
|
|
if verbose >= 1:
|
|
|
|
log(s)
|
|
|
|
|
|
|
|
def debug2(s):
|
|
|
|
if verbose >= 2:
|
|
|
|
log(s)
|
2010-05-02 08:23:42 +02:00
|
|
|
|
2010-05-08 07:30:34 +02:00
|
|
|
def debug3(s):
|
|
|
|
if verbose >= 3:
|
|
|
|
log(s)
|
|
|
|
|
2010-05-02 08:23:42 +02:00
|
|
|
|
|
|
|
class Fatal(Exception):
|
|
|
|
pass
|