Example #1
0
        static void WriterMain()
        {
            for (int i = 0; i < 1000; ++i)
            {
                MMLog.Append(TraceEventType.Information, i, LogComponent.Client,
                             "CMain", "Foo", String.Format("qwe {0}", i));
            }

            s_exit = true;
        }
Example #2
0
        static void SpamMain()
        {
            int i = 0;

            while (s_exit == false)
            {
                MMLog.Append(TraceEventType.Information, 123, LogComponent.Client, "kala", "hdr", String.Format("qwe {0}", i++));
                System.Threading.Thread.Sleep(1000);
            }
        }
Example #3
0
        void OnNewEntries()
        {
            if (this.Halt == true)
            {
                return;
            }

            var entries = MMLog.ReadNewEntries(m_logIndex, out m_logIndex);

            AddRange(entries);
        }
Example #4
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);

            var conv = (LogEntryToBgBrushConverter)this.Resources["bgConverter"];

            conv.Wnd = this;

            var dataView = CollectionViewSource.GetDefaultView(logListView.ItemsSource);

            dataView.Filter = DataFilter;

            OnNewEntries();

            MMLog.RegisterChangeCallback(OnNewEntriesSafe);
        }
Example #5
0
        static void ReaderMain()
        {
            int sinceIdx = 0;
            int tick     = 0;

            while (s_exit == false)
            {
                var entries = MMLog.ReadNewEntries(sinceIdx, out sinceIdx);

                for (int i = 0; i < entries.Length; ++i)
                {
                    if (entries[i].Tick != tick)
                    {
                        throw new Exception();
                    }

                    tick++;
                }
            }
        }
Example #6
0
 void OnNewEntriesSafe()
 {
     this.Dispatcher.BeginInvoke(new Action(OnNewEntries),
                                 System.Windows.Threading.DispatcherPriority.Background);
     MMLog.RegisterChangeCallback(OnNewEntriesSafe);
 }