Adding support for capturing the output of a node instance for custom logging implementations.

This commit is contained in:
Paul Knopf
2016-07-15 00:42:17 -04:00
committed by SteveSandersonMS
parent a14d9ba2df
commit 27ffa72e0d
7 changed files with 52 additions and 9 deletions

View File

@@ -46,10 +46,10 @@ namespace Microsoft.AspNetCore.NodeServices
switch (options.HostingModel)
{
case NodeHostingModel.Http:
return new HttpNodeInstance(options.ProjectPath, options.WatchFileExtensions, /* port */ 0);
return new HttpNodeInstance(options.ProjectPath, options.WatchFileExtensions, /* port */ 0, options.NodeInstanceOutputLogger);
case NodeHostingModel.Socket:
var pipeName = "pni-" + Guid.NewGuid().ToString("D"); // Arbitrary non-clashing string
return new SocketNodeInstance(options.ProjectPath, options.WatchFileExtensions, pipeName);
return new SocketNodeInstance(options.ProjectPath, options.WatchFileExtensions, pipeName, options.NodeInstanceOutputLogger);
default:
throw new ArgumentException("Unknown hosting model: " + options.HostingModel);
}