1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #region --------------- Copyright Dresser Wayne Pignone -------------
- /*
- * $Log: /Wrk/WayneLibraries/Wrk/Log/LogTextWriting.cs $
- *
- * 2 08-02-13 9:54 Mattias.larsson
- * Support LogTextWritingParameters.
- *
- * 1 08-01-23 16:34 Mattias.larsson
- */
- #endregion
- using System.Text;
- namespace Wayne.Lib.Log
- {
- internal static class LogTextWriting
- {
- #region Methods
- public static string GetLogEntryText(LogWriter logWriter, LogEntry logEntry, LogTextWritingParameters writingParameters)
- {
- StringBuilder output = new StringBuilder();
- if (!string.IsNullOrEmpty(writingParameters.DateTimeFormat))
- {
- output.Append(logEntry.GetDateTimeString(writingParameters.DateTimeFormat));
- output.Append(" ");
- }
- if ((writingParameters.EntityLogKind != EntityLogKind.None) || !writingParameters.SuppressCategory)
- {
- output.Append(logEntry.EntityCategory.GetName(writingParameters.EntityLogKind, writingParameters.SuppressCategory));
- output.Append(": ");
- }
- int indentLength = output.Length;
- bool isFirstLine = true;
- string indent = null;
- logEntry.AppendToStringBuilder(logWriter, output, indentLength, ref isFirstLine, ref indent);
- return output.ToString();
- }
- #endregion
- }
- }
|