Browse Source

Add more bundling logs

pull/301/head
Halil ibrahim Kalkan 8 years ago
parent
commit
5245b35759
  1. 11
      src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerBase.cs

11
src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerBase.cs

@ -27,24 +27,27 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling
public BundleResult Bundle(IBundlerContext context)
{
Logger.LogDebug($"Bundling {context.BundleRelativePath}");
Logger.LogInformation($"Bundling {context.BundleRelativePath} ({context.ContentFiles} files)");
var sb = new StringBuilder();
Logger.LogDebug("Bundle files:");
foreach (var file in context.ContentFiles)
{
sb.AppendLine(GetFileContent(context, file));
var fileContent = GetFileContent(context, file);
Logger.LogDebug($"- {file} ({fileContent.Length} bytes)");
sb.AppendLine(fileContent);
}
var bundleContent = sb.ToString();
if (context.IsMinificationEnabled)
{
Logger.LogDebug($"Minifying {context.BundleRelativePath}");
Logger.LogInformation($"Minifying {context.BundleRelativePath} ({bundleContent.Length} bytes)");
bundleContent = Minifier.Minify(bundleContent, context.BundleRelativePath);
}
Logger.LogDebug($"Bundled {context.BundleRelativePath}");
Logger.LogInformation($"Bundled {context.BundleRelativePath} ({bundleContent.Length} bytes)");
return new BundleResult(bundleContent);
}

Loading…
Cancel
Save