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

Reduce loglevel for non-annotated java methods in rule classes #125

Merged
merged 1 commit into from
Feb 12, 2023

Conversation

seime
Copy link
Collaborator

@seime seime commented Feb 12, 2023

As mentioned on forum https://community.openhab.org/t/jrule-openhab-rules-using-java/121441/133

Myself I also have a hundred non-rule java methods that create a lot of (masquerading) noise in the logs on rule reloading.

@querdenker2k
Copy link
Collaborator

maybe we can completely remove the logging for lambda methods?
i am a little bit stressed of this warnings as well

@seime
Copy link
Collaborator Author

seime commented Feb 12, 2023

I think it is good to have some debug logging to look at when things are not working as expected.

@querdenker2k
Copy link
Collaborator

of course, but its not possible to annotate lambda methods and when i am searching for problems why some rules are not executed i often see some lambda methods which are not annotated. For me it's a little bit confusing.
But when you don't think so i will accept the MR.

@seime
Copy link
Collaborator Author

seime commented Feb 12, 2023

The code I find hardest to debug is chained lamba expressions with no logging at all.
Thus useful logging that contains some context data is to me crucial.

Maybe I do not understand what you mean?

@querdenker2k
Copy link
Collaborator

I have a lot of these messages while starting (or updading a rule)
[JRuleEngine] Skipping method lambda$chargeCar$2 on class org.openhab.automation.jrule.rules.user.Car since JRuleName annotation is missing
and this is the lambda

var usingAmpere = availablePower
                .map(aDouble -> aDouble + ALLOWED_EXTRA_POWER)
                .map(this::calculateMaxAmpere);

and just the lambda can never be an JRule triggered rule and would therefor never had JRule annotations.

@seime
Copy link
Collaborator Author

seime commented Feb 12, 2023

Yes, this PR just changes the log level from warn to debug.
I can live without this specific log statement if you instead like to remove it.

@querdenker2k
Copy link
Collaborator

@seime all right, i will create a new pr for this

@querdenker2k querdenker2k merged commit 39ee557 into seaside1:main Feb 12, 2023
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.

2 participants