Exemplo n.º 1
0
 public void OnLogMessage(SerializableLogMessage logMessage)
 {
     Log.Log(logMessage);
 }
Exemplo n.º 2
0
        void Log_MessageLogged(object sender, MessageLoggedEventArgs e)
        {
            var message = e.Message;

            var serializableMessage = message as SerializableLogMessage;
            if (serializableMessage == null)
            {
                var logMessage = message as LogMessage;
                if (logMessage != null)
                {
                    // Ignore MicroThreadCancelledException (they are supposed to be intentionally triggered by live scripting reloading)
                    if (logMessage.Exception is MicroThreadCancelledException)
                        return;

                    serializableMessage = new SerializableLogMessage(logMessage);
                }
            }

            if (serializableMessage == null)
            {
                throw new InvalidOperationException(@"Unable to process the given log message.");
            }

            host.OnLogMessage(serializableMessage);
        }
Exemplo n.º 3
0
 public void ForwardSerializableLog(SerializableLogMessage message)
 {
     buildMonitorCallback.Message(message.Type.ToString(), message.Module, message.Text);
 }
Exemplo n.º 4
0
        void Log_MessageLogged(object sender, MessageLoggedEventArgs e)
        {
            var message = e.Message;

            var serializableMessage = message as SerializableLogMessage;
            if (serializableMessage == null)
            {
                var logMessage = message as LogMessage;
                if (logMessage != null)
                {
                    serializableMessage = new SerializableLogMessage(logMessage);
                }
            }

            if (serializableMessage == null)
            {
                throw new InvalidOperationException(@"Unable to process the given log message.");
            }

            host.OnLogMessage(serializableMessage);
        }
 public void ForwardLog(SerializableLogMessage message)
 {
     commandContext.Logger.Log(new LogMessage(message.Module, message.Type, message.Text));
     if (message.ExceptionInfo != null)
         commandContext.Logger.Log(new LogMessage(message.Module, message.Type, message.ExceptionInfo.ToString()));
 }