public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     var stringLogTitle = logEntry.Title as StringLogTitle;
     if (stringLogTitle != null)
     {
         stringBuilder.Append(stringLogTitle.Title);
     }
     else
     {
         var openLogScope = logEntry.Title as OpenLogScopeTitle;
         if (openLogScope != null)
         {
             stringBuilder.Append("Open[");
             stringBuilder.Append(logEntry.LogScopeId);
             stringBuilder.Append("]");
         }
         else
         {
             var closeLogScope = logEntry.Title as CloseLogScopeTitle;
             if (closeLogScope != null)
             {
                 stringBuilder.Append("Close[");
                 stringBuilder.Append(logEntry.LogScopeId);
                 stringBuilder.Append("]");
             }
         }
     }
 }
 public void Render(StringBuilder stringBuilder,IStringRenderer stringRenderer, LogEntry logEntry)
 {
     for (int i = 0; i < m_writers.Length; i++)
     {
         m_writers[i].Render(stringBuilder, stringRenderer, logEntry);
     }
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.Append(m_property);
     if (logEntry.Paramaeter != null)
     {
         stringRenderer.Render(m_parmExtractor.DynamicInvoke(logEntry.Paramaeter), stringBuilder);
     }
 }
Exemplo n.º 4
0
 public bool Filter(LogEntry logEntry)
 {
     if (m_filter != null)
     {
         return m_filter.Filter(logEntry);
     }
     return false;
 }
Exemplo n.º 5
0
 public bool Filter(LogEntry logEntry)
 {
     if ((logEntry.Title.Id & ReservedLogTitleIds.ReservedLogTitle) == ReservedLogTitleIds.ReservedLogTitle)
     {
         return (logEntry.Title.Id & m_mask) != 0;
     }
     return false;
 }
Exemplo n.º 6
0
        public void LogWithNotTimeSet(LogEntry logEntry)
        {
            logEntry.LogScopeId = m_logScopeSyncImplementation.GetScopeId();

            var temp = LogEntry;
            if (temp != null)
            {
                temp.Invoke(logEntry);
            }
        }
Exemplo n.º 7
0
 public bool Filter(LogEntry logEntry)
 {
     for (int i = 0; i < m_filters.Length; i++)
     {
         if (!m_filters[i].Filter(logEntry))
         {
             return false;
         }
     }
     return true;
 }
Exemplo n.º 8
0
        public void Log(LogEntry logEntry)
        {
            logEntry.Time = m_systemTime.Now();
            logEntry.LogScopeId = m_logScopeSyncImplementation.GetScopeId();

            var temp = LogEntry;
            if (temp != null)
            {
                temp.Invoke(logEntry);
            }
        }
Exemplo n.º 9
0
 public ColorLine GetColor(LogEntry logEntry)
 {
     var temp = m_conditions;
     for (int i = 0; i < temp.Length; i++)
     {
         var currCondition = temp[i];
         if (currCondition.Item1.Invoke(logEntry))
         {
             return currCondition.Item2;
         }
     }
     return DefaultColor;
 }
Exemplo n.º 10
0
 private void aggregateLog_LogEntry(LogEntry logEntry)
 {
     var buffer = m_logEntryBufferAllocator.Allocate();
     try
     {
         buffer.DateTime = logEntry.Time;
         var dataSerializer = buffer.AttachedSerializer;
         m_streamLogBinaryPackager.Pack(logEntry, dataSerializer);
         dataSerializer.Flush();
         m_logEntrySubmiter.AddEntry(buffer);
     }
     finally
     {
         buffer.Dispose();
     }
 }
Exemplo n.º 11
0
 public ColorLine GetColor(LogEntry logEntry)
 {
     switch (logEntry.Title.Id)
     {
         case ReservedLogTitleIds.Fatal:
             return Fatal;
         case ReservedLogTitleIds.Error:
             return Error;
         case ReservedLogTitleIds.Warning:
             return Warning;
         case ReservedLogTitleIds.Debug:
             return Debug;
         case ReservedLogTitleIds.Info:
             return Info;
         case ReservedLogTitleIds.Trace:
             return Trace;
         default:
             return Empty;
     }
 }
Exemplo n.º 12
0
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.Append(DateTime.Now);
 }
Exemplo n.º 13
0
 public void Append(string value,LogEntry logEntry)
 {
     if (m_colorSchema == null)
     {
         m_consoleLogEntrySubmitter.AddLogEntry(value,ColorLine.Empty);
     }
     else
     {
         var colorLine = m_colorSchema.GetColor(logEntry);
         m_consoleLogEntrySubmitter.AddLogEntry(value,colorLine);
     }
 }
Exemplo n.º 14
0
        public bool Filter(LogEntry logEntry)
        {
            if (!m_isConsoleOutputAvaliable)
            {
                return true;
            }

            if (m_filter != null)
            {
                return m_filter.Filter(logEntry);
            }

            return false;
        }
Exemplo n.º 15
0
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.Append(m_stringPattern);
 }
Exemplo n.º 16
0
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.Append(logEntry.LogScopeId);
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.Append(System.Threading.Thread.CurrentThread.ManagedThreadId);
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringRenderer.Render(logEntry.Paramaeter, stringBuilder);
 }
 public void Render(StringBuilder stringBuilder, IStringRenderer stringRenderer, LogEntry logEntry)
 {
     stringBuilder.AppendLine();
 }
Exemplo n.º 21
0
 public void Append(string value, LogEntry logEntry)
 {
     m_submitEntry.Submit(value,logEntry.Time);
 }