// Triton.Common.LogUtilities.CustomLogger // Token: 0x0600177C RID: 6012 RVA: 0x000D3F1C File Offset: 0x000D211C public void AddWpfListener(ScrollViewer scrollViewer, RichTextBox rtbLog) { PatternLayout patternLayout = new PatternLayout("%message"); this.wpfRtfAppender_0 = new WpfRtfAppender(scrollViewer, rtbLog) { Layout = patternLayout }; LevelRangeFilter levelRangeFilter = new LevelRangeFilter(); levelRangeFilter.LevelMin = this.level_0; levelRangeFilter.LevelMax = this.level_1; this.wpfRtfAppender_0.AddFilter(levelRangeFilter); patternLayout.ActivateOptions(); this.wpfRtfAppender_0.ActivateOptions(); AsyncAppender asyncAppender = new AsyncAppender(); asyncAppender.AddAppender(this.wpfRtfAppender_0); asyncAppender.ActivateOptions(); ((Hierarchy)LogManager.GetRepository(this.string_0)).Root.AddAppender(asyncAppender); }
原文:https://www.cnblogs.com/chucklu/p/11372019.html