Skip to content

Suppress MacSysctl Warning Logs#2212

Merged
dbwiddis merged 10 commits into
oshi:masterfrom
golepavan:suppress_macproc_logs
Oct 14, 2022
Merged

Suppress MacSysctl Warning Logs#2212
dbwiddis merged 10 commits into
oshi:masterfrom
golepavan:suppress_macproc_logs

Conversation

@golepavan

Copy link
Copy Markdown
Contributor

No description provided.

@sonatype-lift

sonatype-lift Bot commented Oct 14, 2022

Copy link
Copy Markdown
Contributor

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

@dbwiddis dbwiddis left a comment

Copy link
Copy Markdown
Member

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?

private static final int P_LP64 = 0x4;
/*
* macOS States:
* macOS States: 7

Copy link
Copy Markdown
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
Copy Markdown
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.


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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@golepavan

Copy link
Copy Markdown
Contributor Author

Yes

@golepavan

Copy link
Copy Markdown
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>
@golepavan golepavan 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