示例#1
0
 /// <summary>
 /// General log function.  Look at TellInfo, TellWarning and TellError for more specific
 /// log functions.
 /// </summary>
 public static void tell(ProcessLogItem logItem)
 {
     if (processId.IsValid)
     {
         Process.tell(processId, logItem);
     }
 }
示例#2
0
            public State EnqeueLogItem(ProcessLogItem logItem)
            {
                var log = Log.Enqueue(logItem);

                if (log.Count() > LogViewMax)
                {
                    log = log.Dequeue();
                }
                return(new State(LogViewMax, log));
            }
示例#3
0
 /// <summary>
 /// Process log inbox
 /// </summary>
 /// <param name="state">State</param>
 /// <param name="msg">Message</param>
 /// <returns>State</returns>
 private static State inbox(State state, ProcessLogItem msg)
 {
     try
     {
         if (isTell)
         {
             publish(msg);
             return(state.EnqeueLogItem(msg));
         }
         else
         {
             reply(state.GetLogSnapshot());
             return(state);
         }
     }
     catch
     {
         // Ignore.  We want the inbox to be robust and not throwing
         // errors that would just be reported back here.
         return(state);
     }
 }