X Tutup
Skip to content

Commit f771f6c

Browse files
authored
v1.9.6
add timestamp in verbose
1 parent 963d04b commit f771f6c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pproxy/__doc__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = "pproxy"
2-
__version__ = "1.9.5"
2+
__version__ = "1.9.6"
33
__license__ = "MIT"
44
__description__ = "Proxy server that can tunnel among remote servers by regex rules."
55
__keywords__ = "proxy socks http shadowsocks shadowsocksr ssr redirect pf tunnel cipher ssl udp"

pproxy/verbose.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ async def realtime_stat(stats):
3838
del history[:1]
3939

4040
def setup(loop, args):
41-
args.verbose = lambda s: sys.stdout.write(s+'\x1b[0K\n') and sys.stdout.flush()
41+
def verbose(s):
42+
if args.v >= 2:
43+
sys.stdout.write('\x1b[32m'+time.strftime('%Y-%m-%d %H:%M:%S')+'\x1b[m ')
44+
sys.stdout.write(s+'\x1b[0K\n')
45+
sys.stdout.flush()
46+
args.verbose = verbose
4247
args.stats = {0: [0]*6}
4348
def modstat(remote_ip, host_name, stats=args.stats):
4449
host_name_2 = '.'.join(host_name.split('.')[-3 if host_name.endswith('.com.cn') else -2:]) if host_name.split('.')[-1].isalpha() else host_name

0 commit comments

Comments
 (0)
X Tutup