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

Disabled Features should be logged #980

Closed
wants to merge 3 commits into from

Conversation

Abhishekk24
Copy link

I added a feature to log a message when a certain function is turned off. This log message will help us know which features are disabled and understand why. It's like a notification that tells us, "Hey, we turned off this specific feature, and here's why." This can be useful for keeping track of the configuration and troubleshooting any issues related to disabled features.

@Abhishekk24 Abhishekk24 requested review from a team as code owners December 9, 2023 13:22
@CLAassistant
Copy link

CLAassistant commented Dec 9, 2023

CLA assistant check
All committers have signed the CLA.

@Abhishekk24 Abhishekk24 changed the title Disabled Features should be logged #898 Disabled Features should be logged Dec 9, 2023
@Zabuzard Zabuzard added the enhancement New feature or request label Dec 10, 2023
@Zabuzard Zabuzard linked an issue Dec 10, 2023 that may be closed by this pull request
@Zabuzard
Copy link
Member

@Abhishekk24 Note that the issue ur fixing was already assigned to another user, who also already created a solution at #899 .

So you might have done "double work" here. Ideally, before starting on an issue, you should get yourself assigned to it first - and if its already assigned to someone, coordinate quickly 🙂

@Abhishekk24
Copy link
Author

Abhishekk24 commented Dec 10, 2023 via email

@Zabuzard
Copy link
Member

Please fix the issues mentioned by the failing checks, thanks.

@Abhishekk24
Copy link
Author

yes sure

@Abhishekk24
Copy link
Author

If there are anymore errors please guide me.. This is all new to me

Comment on lines +81 to +82
public static Collection<Feature> createFeatures(JDA jda, Database database, Config config,
Logger logger) {
Copy link
Member

Choose a reason for hiding this comment

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

y don't u just create a logger in this class

Comment on lines +168 to +172
return features.stream().filter(f -> !blacklist.isEnabled(f.getClass())).peek(f -> {
// Log INFO level message for each disabled feature using the provided logger
String message = "Feature '" + f.getClass().getSimpleName() + "' is disabled.";
logger.info(message);
}).toList();
Copy link
Member

Choose a reason for hiding this comment

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

as u can see using peek is forbidden, so just put the log in filter method.

Also ur changing the logic before it removed the blacklisted features and kept all others, now it'll do the opposite

@Taz03 Taz03 closed this Mar 16, 2024
@Taz03
Copy link
Member

Taz03 commented Mar 16, 2024

merged #1048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disabled Features should be logged
4 participants