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

Logging improvement #118

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

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