Permalink
Browse files

[windoc] Redirect console output to a log file

  • Loading branch information...
1 parent 1f5159e commit 492d95002d246d24ad539d75fda415d72e3204f6 @garuma garuma committed May 2, 2012
Showing with 10 additions and 1 deletion.
  1. +2 −0 windoc/WinDoc/DocTools.cs
  2. +8 −1 windoc/WinDoc/Program.cs
@@ -17,6 +17,8 @@ public static string GetHtml (string url, HelpSource helpSource)
public static string GetHtml (string url, HelpSource helpSource, out Node match)
{
+ Console.WriteLine ("Calling URL {0} with HelpSource {1}", url, helpSource == null ? "(null)" : helpSource.Name);
+
string htmlContent = null;
match = null;
View
@@ -23,9 +23,10 @@ static void Main(string[] args)
{ "docdir=", dir => docSources.Add (dir) },
}.Parse (args);
+ SetupLogging ();
PrepareCache ();
ExtractImages ();
-
+
// Load documentation
Root = RootTree.LoadTree (null);
foreach (var dir in docSources)
@@ -80,6 +81,12 @@ static void ExtractImages ()
}
}
+ static void SetupLogging ()
+ {
+ var log = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "WinDoc", "windoc.log");
+ Console.SetOut (new StreamWriter (log, true));
+ }
+
public static RootTree Root {
get;
private set;

0 comments on commit 492d950

Please sign in to comment.