protected void PrintReturnCode(InstallResult result, IComponent package, ComponentAction executeAction) { if (result.IsFailure()) { var installResultDetails = GetInstallResultDetails(result, package, executeAction.ToString().ToLowerInvariant()); LogFailure(package, executeAction, installResultDetails); } else { var text = "Result: " + result; Logger.Trace("Package executed successfully. {0}", text); } }
private static void LogFailure(IComponent package, ComponentAction executeAction, string details) { Logger.Error(package != null ? $"Package '{package.Name}' failed to {executeAction.ToString().ToLowerInvariant()}. {details}" : $"Failed to {executeAction.ToString().ToLowerInvariant()}. {details}"); }