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
Show OS info in debug messages #2498
Conversation
LGBI, can't test ATM due to the requirement for Glib 2.64. Pending testing it I might suggest making it one line (in printf) "OS: %s %s", name, version and leave Pretty Name off. But I guess it depends on what it looks like on various systems, for example will Linux Mint be only in Pretty name and Ubuntu be in Name or how else will derived distros be shown? TBD also when anyone can try it on Windows and OSX. |
Yeah, I've only tested on Ubuntu 20.04 so not sure, but if it's consistent, I agree that name/version is enough or even just pretty name really. |
Yay! The result of Output on ArchLinux:
Output on Windows 7:
The missing version on ArchLinux is OK because it's a rolling release and |
I assumed based on the lack of
Thanks for testing! Based on the output on Ubuntu, Arch and Windows so far, I suggest we go with only printing the "pretty name", like just this one printf: geany_debug("OS: %s", get_os_info_field(G_OS_INFO_KEY_PRETTY_NAME)); Sound good? @techee would it be possible that you could test this on Macos? I'm not sure how involved that would be, if it's too much trouble, no worries. |
Sounds good to me to use mainly |
@codebrainz I guess we could go ahead even without MacOS results. |
I added a commit to update as discussed. Output looks like this now:
|
Just for reference, I get
on macOS - |
Thanks for testing. You're right, it looks like I guess we could add a check for Macos in our code and make it output something a little more useful. |
Would be probably better to update glib itself, otherwise we have to include macos headers and link against macos frameworks by ourselves which we don't have to do now. But I don't think it's something too critical to have. |
Definitely would be better to upstream, but probably too much trouble.
Agree. It might be good to just |
Or just #ifdef it to say something like "Unidentified Macos version" so at least that much is obvious. |
I would just leave it as it is - this is not something worth ifdefs or any extra code IMO. |
Too late, I already created follow-up #2618, which puts it in a self-contained utils function, making the main code flow cleaner than in this PR and allowing support for older GLibs and MacOS/others. There was already |
And since @codebrainz already did the work, let's continue with #2618. |
This PR conditionally uses newer GLib API to get information about the OS and to print it in with the existing debug messages. I don't really have a preference on the formatting of the info, this PR is tested against own-built Geany on Ubuntu 20.04.
Example: