def debug(lvl, msg): if lvl <= debug_level: sys.stderr.write("%s: %s\n" % (realtime.elapsed_str(), msg))
def error(msg): sys.stderr.write("ERROR occurred at %s:\n%s\n" % (realtime.elapsed_str(), msg))