コード例 #1
0
ファイル: TestLog.cs プロジェクト: amazing-andrew/FtpServer
        protected override void LogCore(SimpleLogEntry entry) {
            StringBuilder sb = new StringBuilder();
            sb.Append(entry.LogName);
            sb.Append(" : ");
            sb.Append(entry.Level);
            sb.Append(" : ");
            sb.Append(entry.Message);

            if (entry.Exception != null) {
                sb.AppendLine();
                sb.Append(GetExceptionString(entry.Exception));
            }

            //send to trace
            System.Diagnostics.Trace.WriteLine(sb.ToString());

            //send to test output
            try { output.WriteLine(sb.ToString()); }
            catch (InvalidOperationException) { }
        }
コード例 #2
0
ファイル: SimpleLog.cs プロジェクト: amazing-andrew/FtpServer
 protected abstract void LogCore(SimpleLogEntry entry);