Skip to content

Commit

Permalink
Easier way to dump the logfile in a handy location
Browse files Browse the repository at this point in the history
  • Loading branch information
synhershko committed Aug 10, 2012
1 parent a8cc18d commit db1dc82
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/NAppUpdate.Framework/Common/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,19 @@ public void Log(Exception exception, string message)
});
}

public void Dump()
{
Dump(null);
}

public void Dump(string filePath)
{
if (string.IsNullOrEmpty(filePath))
{
var workingDir = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
filePath = Path.Combine(workingDir ?? string.Empty, @"NauUpdate.log");
}

using (StreamWriter w = File.CreateText(filePath))
foreach (var logItem in LogItems)
{
Expand Down

0 comments on commit db1dc82

Please sign in to comment.