-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JSON (partial) #233
base: master
Are you sure you want to change the base?
Add JSON (partial) #233
Conversation
Thanks for your PR. JSON output will be a great feature for multimon-ng, as many are building applications on top of it. But I am a bit unsure what the best pathway for an incomplete implementation is, that may need a bit more time to mature. Maybe we can keep it in its own branch and see if others want to polish it further. Do you have plans to keep working on it? |
Hi sorry for the delays from me! Yeah, this feature I think is sorely needed -- JSON, or perhaps even a C API (meaning, being able to call C/multimon from say, Python). I'm using my branch at the moment in my mmng-ui project Agreed re in it's own branch; my current contribution is tiny and far from complete. Should we perhaps move my branch to your repo, allowing others to contribute? Or keep it where it is? I plan on continuing to work on it, but as stated, I haven't been a C/C++ programmer for 20+ years, so I could be wasting my and others' time writing terrible code. |
My rough TODO list, based on uses of
|
(BTW, I'm committing these individually so that if any comments are needed, they are easily put in context with whatever change I've done.) |
Question time @EliasOenal -- of the remainder here, is a JSON mode even logical?
It kinda seems to me no? Except maybe morse. |
Thanks a lot for the hard work. Since we don't have better abstractions in place for the output generation, the resulting changes are a very verbose with the if-checks and cJSON calls. But that's surely not on you, we shouldn't have had that many prints to begin with. I'll perform some testing, but afterwards I'll be happy to merge it. @lingfish if you don't mind, may we add your name? We try to attribute authorship properly to make it easier for the various package maintainers (Debian, Ubuntu, etc.) to track. Since the feature gets enabled in unixinput.c, could you put your name there below line 9? The distributions use automated tools to extract the names from all source files to list within the packages. But you may add it to the GPL headers of the other source files as well, if you want.
Edit: |
No problem.
Yeah I think perhaps a combo of feature-creep, and the different nature of incrementally printing to console, versus JSON output that needs to be batched and sent all at once. I did want to just hook into your main print function, but that would have been hard/need to buffer etc. A more major overhaul of it would be beyond my ancient C skills.
Will do. Do you want me to squash a lot of commits here as well, or no?
Agreed. |
No need to squash commits unless you prefer so, I don't mind them. |
As per my comments in #190 this is a minimally-working attempt.
Again, I'm not a C programmer these days, and it might be rough. Hoping the devs or others can chip in and help out.