4 using System.Collections.Generic;
5 using System.ServiceModel;
7 using SiliconStudio.Assets.Diagnostics;
8 using SiliconStudio.Core.Diagnostics;
10 namespace SiliconStudio.Assets.CompilerApp
14 private readonly
ILogger mainLogger;
15 private readonly List<IForwardSerializableLogRemote> remoteLogs =
new List<IForwardSerializableLogRemote>();
19 this.mainLogger = mainLogger;
21 foreach (var logPipeName
in logPipeNames)
23 var namedPipeBinding =
new NetNamedPipeBinding(NetNamedPipeSecurityMode.None) { SendTimeout = TimeSpan.FromSeconds(300.0) };
24 var remoteLog = ChannelFactory<IForwardSerializableLogRemote>.CreateChannel(namedPipeBinding,
new EndpointAddress(logPipeName));
25 remoteLogs.Add(remoteLog);
31 foreach (var remoteLog
in remoteLogs)
36 var channel = remoteLog as ICommunicationObject;
50 if (serializableMessage == null)
53 if (assetMessage != null)
55 assetMessage.Module = mainLogger.Module;
61 serializableMessage = logMessage != null ?
new SerializableLogMessage(logMessage) : null;
65 if (serializableMessage == null)
67 throw new ArgumentException(
@"Unable to process the given log message.",
"message");
70 foreach (var remoteLog
in remoteLogs)
74 remoteLog.ForwardSerializableLog(serializableMessage);
A class that represents a copy of a LogMessage that can be serialized.
override void OnLog(ILogMessage message)
Called when a log occurred.
A base log message used by the logging infrastructure.
A base class to implement a log listener
Provides a specialized LogMessage to give specific information about an asset.
The base interface for log messages used by the logging infrastructure.
RemoteLogForwarder(ILogger mainLogger, IEnumerable< string > logPipeNames)
override void Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resourc...