NAppUpdate icon indicating copy to clipboard operation
NAppUpdate copied to clipboard

Logging improvement

Open firsinanton opened this issue 8 years ago • 2 comments

Logging bug fixes and improvements:

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

firsinanton avatar Feb 16 '18 06:02 firsinanton

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

synhershko avatar Feb 24 '18 22:02 synhershko

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?

firsinanton avatar Feb 28 '18 06:02 firsinanton