refactor(logging): separate logging from main#2110
Merged
ReenigneArcher merged 4 commits intonightlyfrom Feb 7, 2024
Merged
Conversation
4b314ee to
dd7bb49
Compare
9c3a29e to
062f017
Compare
062f017 to
f46d2ac
Compare
a922f4e to
9e968dd
Compare
cgutman
reviewed
Feb 7, 2024
e936298 to
5eaab32
Compare
11 tasks
KuleRucket
pushed a commit
to KuleRucket/Sunshine
that referenced
this pull request
Jun 6, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In order to properly implement unit testing,
main.cppneeds to be split out... sosrc/main.cppcan be excluded as a source for the test binary. Otherwise when the test is started, it just starts Sunshine, instead of starting the tests.Also, it will help with the ability to test things currently in main. See https://cuhkszlib-xiaoxing.readthedocs.io/en/latest/external/gtest/googletest/docs/FAQ.html#how-do-i-test-a-file-that-defines-main
This PR pulls logging functions out of main. I started with logging because it is probably the most used out of anything.
In some cases
main.hcould be removed from the includes if it was only relying on logging. Somehow the code in the newlogging.hprovidesassertand in cases where that became undefined I opted to use<cassert>instead if logging was not needed in that file.Screenshot
Issues Fixed or Closed
Type of Change
.github/...)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.