diff options
author | Devaev Maxim <[email protected]> | 2018-07-03 07:03:09 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-07-03 07:03:09 +0300 |
commit | fb60b0dd600bad962aa8163d9dabb6daade7e066 (patch) | |
tree | ba2541d5c5f58f9c5b2836a8d4fc99e18743e80b /kvmd | |
parent | 67439d61941882e3c267c774f4f38c4c4848d3d0 (diff) |
wscli: timestamps
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/kvmd/extras/wscli/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/kvmd/extras/wscli/__init__.py b/kvmd/kvmd/extras/wscli/__init__.py index 3812871d..aa2d2e63 100644 --- a/kvmd/kvmd/extras/wscli/__init__.py +++ b/kvmd/kvmd/extras/wscli/__init__.py @@ -5,6 +5,7 @@ import sys import signal import asyncio import argparse +import time import aiohttp @@ -24,12 +25,12 @@ async def _run_client(loop: asyncio.AbstractEventLoop, url: str) -> None: while True: msg = await ws.receive() if msg.type == aiohttp.WSMsgType.TEXT: - print("Received:", msg.data.strip()) + print("[%.5f] Received: %s" % (time.time(), msg.data.strip())) else: if msg.type == aiohttp.WSMsgType.CLOSE: await ws.close() elif msg.type == aiohttp.WSMsgType.ERROR: - print("Error during receive:", ws.exception()) + print("[%.5f] Error during receive: %s" % (time.time(), ws.exception())) elif msg.type == aiohttp.WSMsgType.CLOSED: pass break |