Skip to content

Conversation

@firsinanton
Copy link

Logging bug fixes and improvements:

  • Empty task descriptions issue
  • Public child conditions for check which of them were met by IUpdateTask

@synhershko
Copy link
Owner

Public child conditions for check which of them were met by IUpdateTask

What does that mean? can you share an example?

For the rest, it looks great, if you could submit as a separate PR I can merge that in

@firsinanton
Copy link
Author

firsinanton commented Feb 28, 2018

What does that mean? can you share an example?

Example from our project (UpdateBootstrapper class, which works with NAppUpdate):

foreach(var updateTask in tasks)
{
var fileUpdateTask = updateTask as FileUpdateTask;
var updateText = fileUpdateTask?.LocalPath ?? updateTask.Description;
var version = fileUpdateTask?.Version;
if(version != null)
version = " [" + version + "]";
log.Info("Обновление: " + updateText + version);
var conditions = updateTask.UpdateConditions.ChildConditions;
foreach(var conditionItem in conditions)
{
var notCondition = conditionItem.ConditionType.HasFlag(BooleanCondition.ConditionType.NOT);
if(conditionItem.Condition.IsMet(updateTask) ^ !notCondition)
continue;
var notPrefix = notCondition ? "not " : null;
log.Debug("Причина: " + notPrefix + conditionItem.Condition);
}
}

This allows us to check for each file what conditions enforced the file update. In some cases it is usefull for detecting problems with update feed.

could submit as a separate PR I can merge that in

What does "separate" mean? Combain commits to single commit?
Or you mean, make PR for making children conditions public only?

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