Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorMichael Hutchinson <m.j.hutchinson@gmail.com>2011-08-24 22:20:39 +0400
committerMichael Hutchinson <m.j.hutchinson@gmail.com>2011-08-24 23:05:47 +0400
commitee3523493159604f65ad5f5a9c3ff310f2b28f4e (patch)
treef9ff99805e3d2227065439e70826d71657bc72d4 /main/src
parentad391d4263ae61a907e08190a5b7fd45b1e3d512 (diff)
[MacDev] Write Xcode4 log to file instead of stdout
Diffstat (limited to 'main/src')
-rw-r--r--main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs28
1 files changed, 14 insertions, 14 deletions
diff --git a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs
index 2aa2de0873..1de8362a59 100644
--- a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs
+++ b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs
@@ -394,32 +394,32 @@ namespace MonoDevelop.MacDev.XcodeSyncing
static class XC4Debug
{
- static bool? enabled;
+ static TextWriter writer;
- public static bool Enabled {
- get {
- if (!enabled.HasValue) {
- var s = Environment.GetEnvironmentVariable ("MD_DEBUG_XCODE_SYNC");
- enabled = "true".Equals (s, StringComparison.OrdinalIgnoreCase);
- }
- return enabled.Value;
+ static XC4Debug ()
+ {
+ FilePath logDir = UserProfile.Current.LogDir;
+ FilePath logFile = logDir.Combine ("Xcode4Sync.log");
+ FileService.EnsureDirectoryExists (logDir);
+ try {
+ writer = new StreamWriter (logFile) { AutoFlush = true };
+ } catch (Exception ex) {
+ LoggingService.LogError ("Could not create Xcode sync logging file", ex);
}
}
public static void Log (string message)
{
- if (!Enabled)
+ if (writer == null)
return;
- Console.Write ("XC4: ");
- Console.WriteLine (message);
+ writer.WriteLine (message);
}
public static void Log (string messageFormat, params object[] values)
{
- if (!Enabled)
+ if (writer == null)
return;
- Console.Write ("XC4: ");
- Console.WriteLine (messageFormat, values);
+ writer.WriteLine (messageFormat, values);
}
}
} \ No newline at end of file