Textualize / toolong

A terminal application to view, tail, merge, and search log files (plus JSONL).
https://www.textualize.io/
MIT License
3.13k stars 54 forks source link

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

Open MiMiMeowMeow opened 1 week ago

MiMiMeowMeow commented 1 week ago

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 commented 6 days ago

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'