本文整理汇总了C#中ILogger.ErrorDetail方法的典型用法代码示例。如果您正苦于以下问题:C# ILogger.ErrorDetail方法的具体用法?C# ILogger.ErrorDetail怎么用?C# ILogger.ErrorDetail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILogger
的用法示例。
在下文中一共展示了ILogger.ErrorDetail方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Process
public bool Process(ILogger logger, IEnumerable<string> args, MetaProjectPersistence metaProject, ComponentsList components, string packagesOutputDirectory)
{
var destination = args.ParseStringParameter("to", metaProject.LastPublishedTo);
if (string.IsNullOrWhiteSpace(destination))
return true;
if (!Directory.Exists(destination)) {
logger.Error("Could not find destination folder: '{0}'", destination);
return true;
}
metaProject.LastPublishedTo = destination;
var componentNamePattern = args.FirstOrDefault(s => !s.StartsWith("-")) ?? ".*";
var list = components.FilterBy(componentNamePattern, nugets: true);
var listIsOk = true;
foreach (var component in list)
if (component is INugetSpec)
if (!BuildHelper.PackageExists(component as INugetSpec, packagesOutputDirectory)) {
listIsOk = false;
logger.ErrorDetail("There is no built package for nuget '{0}'", component.Name);
}
if (listIsOk)
foreach (var component in list)
if (component is INugetSpec)
BuildHelper.CopyIfNew(logger, component as INugetSpec, packagesOutputDirectory, destination);
return true;
}
示例2: ParsePartToBump
private static VersionPart ParsePartToBump(ILogger logger, IEnumerable<string> args)
{
var defaultPart = "revision";
var part = args.ParseStringParameter("part", defaultPart);
var versionPart = TranslateToVersionPart(part);
if (versionPart != VersionPart.None)
return versionPart;
logger.ErrorDetail("Invalid value for 'part' option: '{0}'. Using default value '{1}'.", part, defaultPart);
return TranslateToVersionPart(defaultPart);
}
示例3: ClearPackageInstallDirectories
public static void ClearPackageInstallDirectories(ILogger logger, IEnumerable<IComponent> components)
{
var installDirs = new List<string>();
foreach (var component in components) {
var installedPackagesDir = component.InstalledPackagesDir;
if ((!installDirs.Contains(installedPackagesDir)) && Directory.Exists(installedPackagesDir))
installDirs.Add(installedPackagesDir);
}
logger.Info("Clearing all package installation directories ({0})", installDirs.Count);
foreach (var dir in installDirs)
foreach (var packageDir in Directory.EnumerateDirectories(dir))
try {
Directory.Delete(packageDir, true);
} catch (Exception e) {
logger.ErrorDetail("Could not delete package installed at {0} . Cause: {1}", dir, e.Message);
}
}
示例4: CopyIfNew
public static void CopyIfNew(ILogger logger, INugetSpec nuget, string packagesOutputDirectory, string destination)
{
var package = nuget.OutputPackageFilename;
var destinationPackage = destination.Combine(package);
if (File.Exists(destinationPackage))
return;
var originPackage = packagesOutputDirectory.Combine(package);
if (File.Exists(originPackage)) {
try {
logger.Info("Publishing package '{0}' to '{1}'", package, destination);
File.Copy(originPackage, destinationPackage);
} catch (Exception e) {
logger.Error(e);
}
} else {
logger.ErrorDetail("No built package for nuget '{0}'", nuget.Name);
}
}
示例5: UpgradePackageDependency
public bool UpgradePackageDependency(ILogger logger, IComponent newPackage, string sourceDirectory, ICollection<string> installDirs)
{
var packagesFile = PackagesConfigFilePath;
if (!File.Exists(packagesFile)) {
logger.ErrorDetail("Probably component '{0}' is referencing the package '{1}' as a project...", Name, newPackage.Name);
return true;
}
try {
UpdatePackagesConfig(newPackage, packagesFile);
UpdatePackageReferencesOnProject(logger, newPackage);
ParseAvailableData();
if (!installDirs.Contains(InstalledPackagesDir))
installDirs.Add(InstalledPackagesDir);
return true;
} catch (Exception e) {
logger.Error(e.Message);
logger.Debug(e);
return false;
}
}
示例6: DoAddNuget
private void DoAddNuget(ILogger logger, INugetSpec nugetComponent, IComponentFinder components, string packagesOutputDirectory, bool firstlevel)
{
try {
if (Dependencies.Any(c => c.Equals(nugetComponent))) {
if (firstlevel)
logger.Info("Component already references nuget {0}", nugetComponent.Name);
} else {
AddToPackagesConfig(nugetComponent, PackagesConfigFilePath);
_dependencies.Add(new NugetReference(nugetComponent));
var framework = nugetComponent.CompatibleFramework(_targetFrameworkVersion);
foreach (var assembly in nugetComponent.AssemblyNames)
FullPath.TransformFile(xml => AddSingleLibReference(xml, nugetComponent.Name, assembly, framework, RelativeInstalledPackagesDir));
}
foreach (var subdependency in nugetComponent.Dependencies) {
var dep = components.FindComponent<INugetSpec>("^" + subdependency.Name + "$", interactive: false);
if (dep != null)
DoAddNuget(logger, dep, components, packagesOutputDirectory, false);
}
if (!Directory.Exists(InstalledPackagesDir.Combine(nugetComponent.Name)))
BuildHelper.InstallPackage(logger, nugetComponent, InstalledPackagesDir, packagesOutputDirectory);
} catch (Exception e) {
logger.ErrorDetail("Could not add all recursive references of needed nugets. Cause: {0}", e.Message);
}
}
示例7: ProcessBuildOutput
private static void ProcessBuildOutput(ILogger logger, string line)
{
if (string.IsNullOrWhiteSpace(line) || (line != line.TrimStart()))
return;
if (line.Contains(" (are you")) // shorten irritating long error message from csc (will it work with mcs?)
line = line.Substring(0, line.IndexOf(" (are you"));
if (line.Contains(": error"))
logger.ErrorDetail(line);
else
logger.Info(line);
}