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

Feature Request: Provide an open API for other plugins to reuse GrepConsole's capabilities #316

Open
nfzsh opened this issue Dec 25, 2024 · 1 comment

Comments

@nfzsh
Copy link

nfzsh commented Dec 25, 2024

Is your feature request related to a problem? Please describe.
I am currently developing an open-source plugin for remote log visualization and would like to reuse GrepConsole’s powerful log processing and highlighting capabilities. However, there doesn’t seem to be a way to programmatically leverage these features, such as applying the same highlighting and formatting rules to externally provided log content.

Describe the solution you'd like
I would like GrepConsole to provide a public API or interface that allows other plugins to:

Programmatically send log content to GrepConsole.
Reuse its existing log processing, highlighting, and formatting rules.
Ideally, this API could include methods to:

Input custom log strings into GrepConsole’s pipeline.
Retrieve the formatted and highlighted results for display or further processing.
Describe alternatives you've considered
As an alternative, I considered re-implementing similar log processing and highlighting functionality in my plugin. However, this would duplicate effort and might not align perfectly with GrepConsole’s behavior or configuration options. Reusing GrepConsole’s capabilities would ensure consistency and reduce development time.

Additional context
The ability to reuse GrepConsole’s capabilities would expand its ecosystem and allow other developers to integrate it into their plugins for a variety of use cases. I am happy to contribute to this effort if needed.

Thank you for considering this request!
My repository: https://github.com/nfzsh/intellij-rancher-plugin/tree/demo
Best regards,
nfzsh

@krasa
Copy link
Owner

krasa commented Dec 25, 2024

Sure, no problem, feel free to make a pull request.

It seems that you just want to do:

			Profile selectedProfile = GrepConsoleApplicationComponent.getInstance().getState().getDefaultProfile();
			HighlightingFilter filter = new HighlightingFilter(project, selectedProfile);
			Filter.Result result = filter.applyFilter(text, text.length());

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

No branches or pull requests

2 participants