mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
fuse-client: add timestamps to logger
This commit is contained in:
parent
1c35de4716
commit
25bd5a823e
|
@ -104,7 +104,7 @@ def rice_tid():
|
||||||
|
|
||||||
|
|
||||||
def fancy_log(msg):
|
def fancy_log(msg):
|
||||||
print("{} {}\n".format(rice_tid(), msg), end="")
|
print("{:10.6f} {} {}\n".format(time.time() % 900, rice_tid(), msg), end="")
|
||||||
|
|
||||||
|
|
||||||
def null_log(msg):
|
def null_log(msg):
|
||||||
|
@ -163,7 +163,7 @@ class RecentLog(object):
|
||||||
thr.start()
|
thr.start()
|
||||||
|
|
||||||
def put(self, msg):
|
def put(self, msg):
|
||||||
msg = "{} {}\n".format(rice_tid(), msg)
|
msg = "{:10.6f} {} {}\n".format(time.time() % 900, rice_tid(), msg)
|
||||||
if self.f:
|
if self.f:
|
||||||
fmsg = " ".join([datetime.utcnow().strftime("%H%M%S.%f"), str(msg)])
|
fmsg = " ".join([datetime.utcnow().strftime("%H%M%S.%f"), str(msg)])
|
||||||
self.f.write(fmsg.encode("utf-8"))
|
self.f.write(fmsg.encode("utf-8"))
|
||||||
|
|
Loading…
Reference in a new issue