mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-22 07:53:43 +01:00
81c89ce9be
We'll introduce a new "Fatal" exception for this purpose, and throw it when we just want to print a user message and abort immediately.
22 lines
277 B
Python
22 lines
277 B
Python
import sys, os
|
|
|
|
logprefix = ''
|
|
verbose = 0
|
|
|
|
def log(s):
|
|
sys.stdout.flush()
|
|
sys.stderr.write(logprefix + s)
|
|
sys.stderr.flush()
|
|
|
|
def debug1(s):
|
|
if verbose >= 1:
|
|
log(s)
|
|
|
|
def debug2(s):
|
|
if verbose >= 2:
|
|
log(s)
|
|
|
|
|
|
class Fatal(Exception):
|
|
pass
|