[tomboy/xdg-migration2: 12/16] Add NativeApp.LogDirectory, always name log file 'tomboy.log'.
- From: Sanford Armstrong <sharm src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tomboy/xdg-migration2: 12/16] Add NativeApp.LogDirectory, always name log file 'tomboy.log'.
- Date: Mon, 24 Aug 2009 02:01:41 +0000 (UTC)
commit 286ca32f7d42b4316716d59e5c2cfe5a007034c0
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date: Sun Aug 23 09:11:24 2009 -0700
Add NativeApp.LogDirectory, always name log file 'tomboy.log'.
Tomboy/GnomeApplication.cs | 4 ++++
Tomboy/Logger.cs | 11 ++++-------
Tomboy/NativeApplication.cs | 2 ++
3 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/Tomboy/GnomeApplication.cs b/Tomboy/GnomeApplication.cs
index c940ec9..a8be33f 100644
--- a/Tomboy/GnomeApplication.cs
+++ b/Tomboy/GnomeApplication.cs
@@ -181,6 +181,10 @@ namespace Tomboy
get { return cacheDir; }
}
+ public string LogDirectory {
+ get { return confDir; }
+ }
+
public string PreOneDotZeroNoteDirectory {
get {
return Path.Combine (Environment.GetEnvironmentVariable ("HOME"),
diff --git a/Tomboy/Logger.cs b/Tomboy/Logger.cs
index 54669c8..46314ca 100644
--- a/Tomboy/Logger.cs
+++ b/Tomboy/Logger.cs
@@ -57,17 +57,14 @@ namespace Tomboy
{
console = new ConsoleLogger ();
-#if WIN32
+ string logDir = Services.NativeApplication.LogDirectory;
string logfile = Path.Combine(
- Services.NativeApplication.ConfDir,
+ logDir,
"tomboy.log");
-#else
- string logfile = Path.Combine(
- Environment.GetEnvironmentVariable ("HOME"),
- ".tomboy.log");
-#endif
try {
+ if (!Directory.Exists (logDir))
+ Directory.CreateDirectory (logDir);
log = File.CreateText (logfile);
log.Flush ();
} catch (IOException iox) {
diff --git a/Tomboy/NativeApplication.cs b/Tomboy/NativeApplication.cs
index 9eff284..e9dfe6b 100644
--- a/Tomboy/NativeApplication.cs
+++ b/Tomboy/NativeApplication.cs
@@ -26,6 +26,8 @@ namespace Tomboy
string DataDirectory { get; }
+ string LogDirectory { get; }
+
void OpenUrl (string url, Gdk.Screen screen);
void DisplayHelp (string help_uri, Gdk.Screen screen);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]