toolong icon indicating copy to clipboard operation
toolong copied to clipboard

Feature Request: command line agrument to tail a socket host/port

Open MiMiMeowMeow opened this issue 1 year ago • 1 comments

Hello,

I have a custom python hander to emit jsonl to a socket. I used toolong to monitor the socket and it works great. I have to pipe it using this command: "nc -lk 9999 | tl". It would be awesome if it had a command line agrument that would accept a socket host/port. This would make this use case workable in Windows easy. I attached the custom hander.

Another feature would be a short cut key to clear the log/session.

Thanks! jsonl_socket_logging.zip

MiMiMeowMeow avatar Oct 06 '24 17:10 MiMiMeowMeow

Tired netcat for windows:

ncat -l -p 9999 | tl

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in run_code File "D:\pypoetry\virtualenvs\aebusspy-huV59KkV-py3.12\Scripts\tl.exe_main.py", line 7, in File "D:\pypoetry\virtualenvs\aebusspy-huV59KkV-py3.12\Lib\site-packages\click\core.py", line 1157, in call return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\pypoetry\virtualenvs\aebusspy-huV59KkV-py3.12\Lib\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "D:\pypoetry\virtualenvs\aebusspy-huV59KkV-py3.12\Lib\site-packages\click\core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\pypoetry\virtualenvs\aebusspy-huV59KkV-py3.12\Lib\site-packages\click\core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\pypoetry\virtualenvs\aebusspy-huV59KkV-py3.12\Lib\site-packages\toolong\cli.py", line 55, in run with open("/dev/tty", "rb", buffering=0) as tty_stdin: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/dev/tty'

MiMiMeowMeow avatar Oct 07 '24 15:10 MiMiMeowMeow