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 rule to limit excessive use of sequential loggers #56

Merged
merged 17 commits into from
Oct 13, 2020

Conversation

MrMcCartney
Copy link
Contributor

No description provided.

@MrMcCartney MrMcCartney linked an issue Oct 12, 2020 that may be closed by this pull request
static final String RULE_NAME = 'Excessive use of Sequential Loggers'
static final String RULE_VIOLATION_MESSAGE = 'Too many sequential loggers of same level in flow '

Map<String, Integer> excessiveLoggers = ["TRACE": 2, "DEBUG": 2, "INFO": 2, "WARN": 2, "ERROR": 2]
Copy link
Contributor

Choose a reason for hiding this comment

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

We should move these strings to either be an enum or static constants, probably not on this class but maybe on the LoggerComponent model class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll try an Enum for now.

Integer count = 0
RuleViolation violation = null
flow.children.each {
if (it.componentName == "logger") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use COMPONENT_NAME from the LoggerComponent model class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Easy enough

adesjardin
adesjardin previously approved these changes Oct 13, 2020
@MrMcCartney MrMcCartney merged commit 4fd4ea1 into develop Oct 13, 2020
@MrMcCartney MrMcCartney deleted the Feature/#44-excessive-loggers branch October 21, 2020 18:30
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.

Excessive use of sequential loggers
3 participants