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

Question: Logger output includes very limited information #27

Open
JamesSkemp opened this issue Jan 13, 2020 · 0 comments
Open

Question: Logger output includes very limited information #27

JamesSkemp opened this issue Jan 13, 2020 · 0 comments

Comments

@JamesSkemp
Copy link

I'm using the current version of the msbuild package in my project. Running npm task via Visual Studio 2019 (build tools version 16.0).

I have the following defined in my gulpfile.js, with the logger code based upon this project's main README:

/**
 * Publish the main solution using msbuild, for a particular configuration.
 * @param {any} callback Gulp task callback.
 * @param {any} siteName Website name/configuration.
 */
function msBuildPublish(callback, siteName) {
	var build = new msbuild(callback);
	build.sourcePath = config.solutionName + '.sln';
	build.logger = function (results) {
		fs.appendFile('./_build-logger-' + siteName + '.txt', '\n' + results, function (err) { });
	};
	build.on('status', function (err, results) {
		fs.appendFile('./_build-' + siteName + '.txt', '\nRESULTS: ' + results, function (err) { });
	});
	build.on('error', function (err, results) {
		fs.appendFile('./_build-' + siteName + '.txt', '\nERROR: ' + results, function (err) { });
	});
	build.on('done', function (err, results) {
		fs.appendFile('./_build-' + siteName + '.txt', '\nDONE: ' + results, function (err) { });
	});
	var overrideParams = [];
	overrideParams.push('/p:Configuration=' + siteName);
	overrideParams.push('/t:Build;GatherAllFilesToPublish');
	overrideParams.push('/consoleloggerparameters:Summary');
	overrideParams.push('/verbosity:minimal');
	// Have each configuration publish to a unique location.
	overrideParams.push('/p:publishUrl=' + config.buildPublishLocation + '\\' + siteName);

	build.config('overrideParams', overrideParams);
	build.config('version', config.buildToolsVersion);
	build.build();
}

Unfortunately this results in log files that look like the following:

_build-siteName.txt:


RESULTS: �[36m  build starting�[39m
DONE: �[42m�[37m
 finished - (0) errors�[39m�[49m

_build-logger-siteName.txt:


�[36m  build starting�[39m
�[42m�[37m
 finished - (0) errors�[39m�[49m

- - - - - - - - - - - - - - - -
build done

What I'm hoping to get is something closer to the output I'm seeing in Visual Studio 2019's Task Runner Explorer console, a trimmed example of which is below:

[13:34:37] Using gulpfile D:\git\Xxx-modules\Gulpfile.js
[13:34:37] Starting 'Publish-Website-bus-dev'...
Microsoft (R) Build Engine version 16.3.2+e481bbf88 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
  Xxx.Foundation.Serialization -> D:\git\Xxx-modules\src\Foundation\Serialization\code\bin\Xxx.Foundation.Serialization.dll
  Copying all files to temporary location below for package/publish:
  obj\Debug\Package\PackageTmp.
  Xxx.Foundation.XxxExtensions -> D:\git\Xxx-modules\src\Foundation\XxxExtensions\code\bin\Xxx.Foundation.XxxExtensions.dll
  Copying all files to temporary location below for package/publish:
  obj\Debug\Package\PackageTmp.
  Xxx.Foundation.Theming -> D:\git\Xxx-modules\src\Foundation\Theming\code\bin\Xxx.Foundation.Theming.dll
  Copying all files to temporary location below for package/publish:
  obj\Debug\Package\PackageTmp.
[...]
  Xxx.Feature.LrmIntegration -> D:\git\Xxx-modules\src\Feature\LrmIntegration\code\bin\Xxx.Feature.LrmIntegration.dll
  Copying all files to temporary location below for package/publish:
  obj\Debug\Package\PackageTmp.
  Auto ConnectionString Transformed obj\Debug\Package\PackageTmp\Views\Web.config into obj\Debug\CSAutoParameterize\transformed\Views\Web.config.
  Xxx.Project.DesignSystemWebsite -> D:\git\Xxx-modules\src\Project\DesignSystemWebsite\code\bin\Xxx.Project.DesignSystemWebsite.dll
  Copying all files to temporary location below for package/publish:
  obj\Debug\Package\PackageTmp.
  Xxx.Feature.SchoolDirectory -> D:\git\Xxx-modules\src\Feature\SchoolDirectory\code\bin\Xxx.Feature.SchoolDirectory.dll
  Copying all files to temporary location below for package/publish:
  obj\Debug\Package\PackageTmp.
  Xxx.Feature.EventCustomization -> D:\git\Xxx-modules\src\Feature\EventCustomization\code\bin\Xxx.Feature.EventCustomization.dll
  Copying all files to temporary location below for package/publish:
  obj\Debug\Package\PackageTmp.
Process terminated with code 0.
  Xxx.Feature.StudentData -> D:\git\Xxx-modules\src\Feature\StudentData\code\bin\Xxx.Feature.StudentData.dll
  Copying all files to temporary location below for package/publish:
  obj\Debug\Package\PackageTmp.
  The solution has completed the Build target.
  The XxxWebsite project has completed the GatherAllFilesToPublish target.
Build succeeded.
    0 Warning(s)
    0 Error(s)
Time Elapsed 00:00:07.97
[13:34:46] Finished 'Publish-Website-bus-dev' after 8.14 s

I've tried disabling the consoleloggerparameters and verbosity switches in the code, but while my VS output includes more information the logged text file contains the exact same information.

Am I missing something in my logging setup that would output more information to the text file I define?

Thanks. :)

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

No branches or pull requests

1 participant