Skip to content

refactor(logging): separate logging from main#2110

Merged
ReenigneArcher merged 4 commits intonightlyfrom
fix(main)-separate-logging-from-main
Feb 7, 2024
Merged

refactor(logging): separate logging from main#2110
ReenigneArcher merged 4 commits intonightlyfrom
fix(main)-separate-logging-from-main

Conversation

@ReenigneArcher
Copy link
Copy Markdown
Member

Description

In order to properly implement unit testing, main.cpp needs to be split out... so src/main.cpp can 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.h could be removed from the includes if it was only relying on logging. Somehow the code in the new logging.h provides assert and 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

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.

  • I want maintainers to keep my branch updated

@ReenigneArcher ReenigneArcher added this to the Implement Unit Testing milestone Feb 6, 2024
@ReenigneArcher ReenigneArcher force-pushed the fix(main)-separate-logging-from-main branch 4 times, most recently from 4b314ee to dd7bb49 Compare February 6, 2024 00:48
@ReenigneArcher ReenigneArcher changed the title fix(main): separate logging from main refactor(logging): separate logging from main Feb 6, 2024
@ReenigneArcher ReenigneArcher force-pushed the fix(main)-separate-logging-from-main branch 2 times, most recently from 9c3a29e to 062f017 Compare February 6, 2024 23:30
@ReenigneArcher ReenigneArcher marked this pull request as ready for review February 6, 2024 23:32
@ReenigneArcher ReenigneArcher force-pushed the fix(main)-separate-logging-from-main branch from 062f017 to f46d2ac Compare February 6, 2024 23:36
@ReenigneArcher ReenigneArcher force-pushed the fix(main)-separate-logging-from-main branch 2 times, most recently from a922f4e to 9e968dd Compare February 7, 2024 02:03
@ReenigneArcher ReenigneArcher force-pushed the fix(main)-separate-logging-from-main branch 2 times, most recently from e936298 to 5eaab32 Compare February 7, 2024 03:28
@ReenigneArcher ReenigneArcher merged commit 0aa4f06 into nightly Feb 7, 2024
@ReenigneArcher ReenigneArcher deleted the fix(main)-separate-logging-from-main branch February 7, 2024 14:59
KuleRucket pushed a commit to KuleRucket/Sunshine that referenced this pull request Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants