mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-24 10:40:23 +00:00
Adding support for capturing the output of a node instance for custom logging implementations.
This commit is contained in:
committed by
SteveSandersonMS
parent
a14d9ba2df
commit
27ffa72e0d
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.NodeServices.HostingModels;
|
||||
using Microsoft.AspNetCore.NodeServices.Util;
|
||||
|
||||
namespace Microsoft.AspNetCore.NodeServices
|
||||
{
|
||||
@@ -19,5 +20,6 @@ namespace Microsoft.AspNetCore.NodeServices
|
||||
public Func<INodeInstance> NodeInstanceFactory { get; set; }
|
||||
public string ProjectPath { get; set; }
|
||||
public string[] WatchFileExtensions { get; set; }
|
||||
public INodeInstanceOutputLogger NodeInstanceOutputLogger { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user