Exemplo n.º 1
0
 private static void RegisterRemoteLogger(IProcessBuilderRemote processBuilderRemote)
 {
     // The pipe might be broken while we try to output log, so let's try/catch the call to prevent program for crashing here (it should crash at a proper location anyway if the pipe is broken/closed)
     // ReSharper disable EmptyGeneralCatchClause
     GlobalLogger.MessageLogged += msg => { try { processBuilderRemote.ForwardLog(msg); } catch { } };
     // ReSharper restore EmptyGeneralCatchClause
 }
Exemplo n.º 2
0
        private static void RegisterRemoteLogger(IProcessBuilderRemote processBuilderRemote)
        {
            // The pipe might be broken while we try to output log, so let's try/catch the call to prevent program for crashing here (it should crash at a proper location anyway if the pipe is broken/closed)
            // ReSharper disable EmptyGeneralCatchClause
            GlobalLogger.GlobalMessageLogged += logMessage =>
            {
                try
                {
                    var assetMessage = logMessage as AssetLogMessage;
                    var message = assetMessage != null ? new AssetSerializableLogMessage(assetMessage) : new SerializableLogMessage((LogMessage)logMessage);

                    processBuilderRemote.ForwardLog(message);
                } catch { }
            };
            // ReSharper restore EmptyGeneralCatchClause
        }
Exemplo n.º 3
0
 public RemoteCommandContext(IProcessBuilderRemote processBuilderRemote, Command command, BuilderContext builderContext, LoggerResult logger)
     : base(command, builderContext)
 {
     this.processBuilderRemote = processBuilderRemote;
     this.logger = logger;
 }