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

Fix runtime disabling of logging #470

Merged
merged 1 commit into from
Jun 19, 2023
Merged

Conversation

Danielius1922
Copy link
Member

Updated the internal representation from an unsigned to a signed integer. The value OC_LOG_LEVEL_DISABLED (=-1) is now to disable logging during runtime. Whether a log level is enabled is checked by the '<' operator. Previously, when casting to uint8_t, the value overflowed to 255, causing all log levels to be enabled. This issue has been resolved by using a signed integer representation.

Updated the internal representation from an unsigned to a signed
integer. The value OC_LOG_LEVEL_DISABLED (=-1) is now to disable
logging during runtime. Whether a log level is enabled is checked
by the '<' operator. Previously, when casting to uint8_t, the value
overflowed to 255, causing all log levels to be enabled.
This issue has been resolved by using a signed integer representation.
@Danielius1922 Danielius1922 requested a review from jkralik June 19, 2023 15:20
@ocf-conformance-test-tool
Copy link

🎉 Thank you for your code contribution! To guarantee the change/addition is conformant to the OCF Specification, we would like to ask you to execute OCF Conformance Testing of your change ☝️ when your work is ready to be reviewed.


ℹ️ To verify your latest change (87ac6d4), label this PR with OCF Conformance Testing.

⚠️ Label is removed with every code change.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@Danielius1922 Danielius1922 merged commit 07d7930 into master Jun 19, 2023
@Danielius1922 Danielius1922 deleted the adam/hotfix/fix-log-level branch June 19, 2023 18:02
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants