Skip to content

Commit f12a8fd

Browse files
committed
Added level and timing information
1 parent 6a16d54 commit f12a8fd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

GitVersionCore/Logger.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ static Logger()
1515

1616
public static void SetLoggers(Action<string> info, Action<string> warn, Action<string> error)
1717
{
18-
WriteInfo = info;
19-
WriteWarning = warn;
20-
WriteError = error;
18+
WriteInfo = LogMessage(info, "INFO");
19+
WriteWarning = LogMessage(warn, "WARN");
20+
WriteError = LogMessage(error, "ERROR");
21+
}
22+
23+
static Action<string> LogMessage(Action<string> logAction, string level)
24+
{
25+
return s => logAction(string.Format("{0} [{1:MM/dd/yy H:mm:ss:ff}] {2}", level, DateTime.Now, s));
2126
}
2227

2328
public static void Reset()

0 commit comments

Comments
 (0)