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

Add Command to Set Logging/Filter Rules at Runtime #4637

Merged
merged 10 commits into from
May 17, 2023

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented May 15, 2023

Description

This PR adds the /c2:loggingrules command. You invoke it like this: /c2:loggingrules chatterino.*.debug=true chatterino.http.debug=false. This will apply both rules. I'm not too sure about the command name/prefix/namespace (my thinking was to have this behind a namespace/prefix, so it's clear that this is a Chatterino command).

This command is mainly for debugging release builds without restarting - so that you get more logs when you attach a debugger/console or even a dedicated program capturing logs.

Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

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

Small nitpicks, otherwise looks good 👍 Thank you

src/controllers/commands/builtin/chatterino/Debugging.hpp Outdated Show resolved Hide resolved
src/controllers/commands/builtin/chatterino/Debugging.cpp Outdated Show resolved Hide resolved
@@ -3211,6 +3212,8 @@ void CommandController::initialize(Settings &, Paths &paths)

this->registerCommand("/shield", &commands::shieldModeOn);
this->registerCommand("/shieldoff", &commands::shieldModeOff);

this->registerCommand("/c2:loggingrules", &commands::setLoggingRules);
Copy link
Member

Choose a reason for hiding this comment

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

Naming is the hardest part - I think I would prefer /c2-set-logging-rules but happy to discuss it further before merging this in

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like a good name to me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd love for us to come up with some convention for release-debug and debug-only commands. I typically use /debug- for release-debug.

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Should've checked the docs a bit more.
@pajlada
Copy link
Member

pajlada commented May 17, 2023

Thank you!

@pajlada pajlada enabled auto-merge (squash) May 17, 2023 20:44
@pajlada pajlada merged commit 347f216 into Chatterino:master May 17, 2023
@Nerixyz Nerixyz deleted the feat/loglevel-cmd branch May 18, 2023 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants