Skip to content

Commit

Permalink
improving error log format
Browse files Browse the repository at this point in the history
  • Loading branch information
fandrei committed Oct 31, 2013
1 parent 55ceafc commit 0106c9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion AppMetrics.WebUtils/WebLogger.cs
Expand Up @@ -34,7 +34,7 @@ public static void Report(object val)
var time = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss");
bool multiLineData = text.Contains('\n');
var buf = (multiLineData)
? string.Format("{0}\r\n{1}\r\n{2}\r\n{3}\r\n", time, Delimiter, text, Delimiter)
? string.Format("{0} {1}\r\n{2}\r\n{3}\r\n", time, DelimiterShort, text, Delimiter)
: string.Format("{0}\t{1}\r\n", time, text);

if (Monitor.TryEnter(Sync, 10 * 1000))
Expand All @@ -56,6 +56,7 @@ public static void Report(object val)
}

static readonly string Delimiter = new string('-', 80);
static readonly string DelimiterShort = new string('-', 80 - 20);
public const string FileName = "log.txt";
static readonly object Sync = new object();
}
Expand Down

0 comments on commit 0106c9f

Please sign in to comment.