-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: waifu log watcher #261
Conversation
8fd5ae0
to
b5eaba6
Compare
@@ -47,5 +47,10 @@ | |||
<option name="TAB_SIZE" value="2" /> | |||
</indentOptions> | |||
</codeStyleSettings> | |||
<codeStyleSettings language="kotlin"> | |||
<indentOptions> | |||
<option name="CONTINUATION_INDENT_SIZE" value="4" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this to a tracked code style as ktlint gets mad at me as I was using 8
continuation indent.
Oh yeh, how do you want to handle branch updates? Do you want me to rebase when I merge other PRs? |
It's fine for me if you want to do it, and it's also okay in my future PRs. |
I guess since you are here, could you update please? I'll try to rebase when I can in the future (it also might depend on the amount of merge conflicts too, I might make you do it then 😉 ) |
b5eaba6
to
08dff4c
Compare
Yes please, I would like this feature ⭐
It would be cool if it was like a right-click menu item like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ❤️ this idea! Why stare at the logs when your waifu can do that for you?
I would like to see a solution the integration test issue though.
@@ -5,3 +5,11 @@ data class AlertConfiguration( | |||
val isDisplayNotificationEnabled: Boolean = false, | |||
val isSoundAlertEnabled: Boolean = false | |||
) | |||
|
|||
object AlertConfigurationAllEnabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about this?
data class AlertConfiguration(
val isAlertEnabled: Boolean = false,
val isDisplayNotificationEnabled: Boolean = false,
val isSoundAlertEnabled: Boolean = false
) {
companion object {
fun allEnabled(): AlertConfiguration =
AlertConfiguration(
isAlertEnabled = true,
isDisplayNotificationEnabled = true,
isSoundAlertEnabled = true
)
}
}
Which in-turn enables AlertConfiguration.allEnabled()
@@ -145,6 +145,68 @@ | |||
</component> | |||
</children> | |||
</grid> | |||
<grid id="21b3" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be documenting the new features in the readme in the feature branches, or should that only happen when a release is cut?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, if it's notable to our end users we should already include in PR for both README file and CHANGELOG, I'll update it.
private var alertShown = false | ||
|
||
override fun getDefaultFilters(project: Project): Array<Filter> = when { | ||
getPluginState().isLogWatcherEnabled -> arrayOf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed my mind, this might be an issue...
I forgot about spring boot tests
@ExtendWith(SpringExtension::class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
classes = [DemoApplication::class])
class DemoApplicationTests(
) {
@Test
fun contextLoads() {
}
@Test
fun contextLoads2() {
}
}
Just have a bunch of these guys running...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this to help out https://github.com/Unthrottled/demo-spring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.eventsBeforeFrustrationSpinner.setValue( this.state.getEventsBeforeFrustration() ); | ||
this.eventsBeforeFrustrationSpinner.setEnabled( allowFrustrationCheckBox.isSelected() ); | ||
this.frustrationProbabilitySlider.setValue( this.state.getProbabilityOfFrustration() ); | ||
this.frustrationProbabilitySlider.setEnabled( allowFrustrationCheckBox.isSelected() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ninja code change
## Log Watcher | ||
settings.tab.log.watcher=Log Watcher | ||
settings.log.watcher.watch.logs=Watch Logs | ||
settings.log.watcher.ignore.case.sensitivity=Ignore case sensitivity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, I would just prefer it to be Ignore case
settings.tab.log.watcher=Log Watcher | ||
settings.log.watcher.watch.logs=Watch Logs | ||
settings.log.watcher.ignore.case.sensitivity=Ignore case sensitivity | ||
settings.log.watcher.header=I'll watch the logs for you senpai! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converted to draft to work on the ff:
|
So something that might make things a bit easier is if the log watcher is only active when a process is running and that process is not a test, wdyt? |
The issue might still show up if for what you've demo wherein there are more than 1 running process which is not a test. For instance, I'll start the application (1 proc), then I'll start a different maven run (2nd proc). I'll set a time for finishing this up 🤞, it gets a bit busy before the holidays 🎅 |
While this is still an issue, only one notification will be present at a time avoiding this issue. See this comment for more details about notification collisions I haven't used the feature as much as I have wanted over time (I haven't had the need to look at logs in a bit). So it may still have some weird edge cases I haven't observed! |
This PR implements watching of logs by keyword and triggers an alert once it's present in the runtime logs.
Demo
Settings
I planned to add this to
Events
tab but this would always be changed by the users so it was added at the second tab, I also plan to enhance this into something more intuitive, like adding action and make it a list of keywords where any keywords present in logs would trigger an alert, and more intuitive if we can select from the logs and add it to the list. But for now, one keyword should suffice the use cases.Some of the use cases:
System.out.println()
,console.log()
, and whatnot, these may not be the best debugging tool but it is one of the best ;). For instance, you've printed a loghacker: I'm in
and add this keyword for waifu to watch and do your stuff without constantly checking the logs 😎