Skip to content
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

Suppress MacSysctl Warning Logs #2212

Merged
merged 10 commits into from
Oct 14, 2022
Merged

Conversation

pavangole
Copy link
Contributor

No description provided.

@sonatype-lift
Copy link
Contributor

sonatype-lift bot commented Oct 14, 2022

⚠️ 26 God Classes were detected by Lift in this project. Visit the Lift web console for more details.

Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks great with a few document requests. Can you also add a change log entry?

// 64-bit flag
private static final int P_LP64 = 0x4;
/*
* macOS States:
* macOS States: 7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this 7 for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think by mistake it gets typed.

# When operating without elevated permissions, this results in frequent error
# messages for failures to read the process environment files. Set this to true
# to receive these warnings.
oshi.os.linux.procfs.logwarning=false

#Macos gives log warning if SYSCTL calls fails
#In order to avoid warning make this property true

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the reasoning for this is the same as Linux (no elevated permissions) can we merge the two paragraphs above? For example (feel free to use different wording) insert a comment right below line 119, # On macOS, process environment is read via sysctl. And then you can put the two settings next to each other.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya thanks for the suggesstion.

@dbwiddis dbwiddis added the hacktoberfest-accepted Accepted during Hacktoberfest label Oct 14, 2022
@dbwiddis
Copy link
Member

Thanks for your contribution! Fantastic job. I'm off for the night but other than the minor comment changes should be good to merge tomorrow.

@pavangole
Copy link
Contributor Author

Yes

@pavangole
Copy link
Contributor Author

Resolves #2206

@dbwiddis dbwiddis linked an issue Oct 14, 2022 that may be closed by this pull request
@dbwiddis dbwiddis added hacktoberfest Issues we're happy for new #Hacktoberfest2020 participants to do and removed hacktoberfest-accepted Accepted during Hacktoberfest labels Oct 14, 2022
@dbwiddis dbwiddis merged commit 008f1d5 into oshi:master Oct 14, 2022
dbwiddis added a commit that referenced this pull request Oct 14, 2022
* Added oshi.os.mac.sysctl.logwarning property

* Superess the sysctl log warning

* Added code to read oshi.os.mac.sysctl.logwarning

* Minor Comment Changes

* Added #2212 to changelog

* Added #2212 to changelog

* Added #2212 to changelog

* Removed 7

* Spotless

* Change log tweaks

Co-authored-by: Daniel Widdis <widdis@gmail.com>
@pavangole pavangole deleted the suppress_macproc_logs branch October 18, 2022 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issues we're happy for new #Hacktoberfest2020 participants to do
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow suppressing sysctl error for known error conditions
2 participants