Skip to content

Commit

Permalink
Norule and managed providers logging adjustments.
Browse files Browse the repository at this point in the history
Relates to #81.

Signed-off-by: Łukasz Dywicki <luke@code-house.org>
  • Loading branch information
splatch committed May 6, 2024
1 parent 535ddee commit 0cb2aa5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Expand Up @@ -77,6 +77,7 @@ public ItemLoader(BundleContext context, @Reference ReadyService readyService, @

File[] files = managed.listFiles(f -> f.getName().contains("item"));
if (files == null) {
logger.info("No files containing 'item' in name found in {}", managed);
return;
}

Expand Down
Expand Up @@ -61,7 +61,7 @@ public LinkLoader(BundleContext context, @Reference ReadyService readyService) {

File[] files = managed.listFiles(f -> f.getName().contains("link"));
if (files == null) {
logger.info("No files matching *thing* name found in {}", managed);
logger.info("No files containing 'link' in name found in {}", managed);
return;
}

Expand Down
Expand Up @@ -92,7 +92,7 @@ public ThingLoader(BundleContext context, @Reference ThingTypeRegistry thingType

File[] files = managed.listFiles(f -> f.getName().contains("thing"));
if (files == null) {
logger.info("No files matching *thing* name found in {}", managed);
logger.info("No files containing 'thing' in name found in {}", managed);
return;
}

Expand Down
Expand Up @@ -278,10 +278,10 @@ private final void fire(Collection<Rule> rules, BiFunction<Rule, Trigger, RuleCo
Set<Condition> conditions = rule.getConditions();
Condition block;
if (conditions != null && (block = isBlocked(conditions)) != null) {
logger.info("Not firing rule {} triggered by {}, condition {} is not met.", rule, trigger, block);
logger.debug("Not firing rule {} triggered by {}, condition {} is not met.", rule, trigger, block);
break;
}
logger.info("Rule {} is triggered by {}.", rule, trigger);
logger.trace("Rule {} is triggered by {}.", rule, trigger);
ruleExecutor.submit(new RuleRunnable(rule, contextFactory.apply(rule, trigger)));
}
}
Expand Down

0 comments on commit 0cb2aa5

Please sign in to comment.