8000 Improvement: Switched Medical Daily Notices from Reports to Log Entries by IllianiBird · Pull Request #6825 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improvement: Switched Medical Daily Notices from Reports to Log Entries #6825

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

Merged
merged 1 commit into from
May 2, 2025

Conversation

IllianiBird
Copy link
Collaborator

Dev Notes

Changed several medical notices from posting to the daily report to instead post to the log. This reduces daily report spam, without losing the information if we ever need to troubleshoot. After we're certain this system is working correctly we can change the log level from 'info' to 'debug'

### Dev Notes
Changed several medical notices from posting to the daily report to instead post to the log. This reduces daily report spam, without losing the information if we ever need to troubleshoot. After we're certain this system is working correctly we can change the log level from 'info' to 'debug'
@IllianiBird IllianiBird added the UX User experience label Apr 29, 2025
@IllianiBird IllianiBird self-assigned this Apr 29, 2025
Copy link
codecov bot commented Apr 29, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 11.45%. Comparing base (6e08f00) to head (cea19e1).
Report is 88 commits behind head on master.

Files with missing lines Patch % Lines
.../campaign/personnel/medical/MedicalController.java 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #6825   +/-   ##
=========================================
  Coverage     11.45%   11.45%           
  Complexity     6499     6499           
=========================================
  Files          1098     1098           
  Lines        140854   140808   -46     
  Branches      21841    21829   -12     
=========================================
+ Hits          16130    16131    +1     
+ Misses       123050   123014   -36     
+ Partials       1674     1663   -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@IllianiBird IllianiBird changed the title Switched Medical Daily Notices from Reports to Log Entries Fix: Switched Medical Daily Notices from Reports to Log Entries Apr 30, 2025
Comment on lines +163 to +164
// TODO change logging level from info to debug in 50.08
logger.info(getFormattedTextAt(RESOURCE_BUNDLE, "MedicalController.report.intro",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I get it, but I would prefer to have an option in campaign options where you can re-enable it to show in the campaign report, start with it disabled so if anyone complains they just have to click a button.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Even with small campaigns (I tested with just a few people in the infirmary) it quickly becomes really spammy. We need the information, but the player has never had access to this information so nobody will notice it missing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Coming back to this later, it's also worth mentioning that posting lots of messages to daily report on New Day actually slows down new day progression so it's something we should be avoiding.

@IllianiBird IllianiBird requested a review from Scoppio May 1, 2025 03:53
@IllianiBird IllianiBird changed the title Fix: Switched Medical Daily Notices from Reports to Log Entries Improvement: Switched Medical Daily Notices from Reports to Log Entries May 1, 2025
@HammerGS HammerGS requested a review from Copilot May 2, 2025 03:29
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR changes the logging of medical events from being added as daily reports to being routed through log entries, reducing spam in the daily report. Key changes include:

  • Replacing campaign.addReport calls with logger.info for medical event reporting.
  • Adding a static logger instance in MedicalController.
  • Removing duplicate imports related to medical events.
Comments suppressed due to low confidence (2)

MekHQ/src/mekhq/campaign/personnel/medical/MedicalController.java:117

  • The logging call uses info level with a TODO comment to switch to debug; consider using a consistent log level constant or updating the configuration once debug logging is confirmed for consistency.
logger.info(getFormattedTextAt(RESOURCE_BUNDLE, "MedicalController.report.natural", patient.getHyperlinkedFullTitle()));

MekHQ/src/mekhq/campaign/personnel/medical/MedicalController.java:175

  • The logging call for the skill check results uses info level with a TODO to change it to debug; ensure that the log level updates are applied uniformly across all similar logging scenarios.
logger.info(skillCheckUtility.getResultsText());

@Scoppio Scoppio merged commit c5bac2d into MegaMek:master May 2, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UX User experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0