Skip to content

Commit

Permalink
Merge pull request #50 from dotob/dev
Browse files Browse the repository at this point in the history
Merging v1.0.2 dev content to master
  • Loading branch information
punker76 authored Dec 7, 2016
2 parents cc50389 + 1dcdec9 commit 1836636
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
3 changes: 2 additions & 1 deletion MONI/Data/MoniSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using MahApps.Metro.Native;
using Newtonsoft.Json;
using System.Linq;
using MONI.Util;

namespace MONI.Data
{
Expand All @@ -14,7 +15,7 @@ public class MoniSettings
public static MoniSettings GetEmptySettings()
{
var ms = new MainSettings {
DataDirectory = AppDomain.CurrentDomain.BaseDirectory,
DataDirectory = Utils.MoniAppDataPath(),//AppDomain.CurrentDomain.BaseDirectory,
MonlistExecutablePath = @"n:\Monlist2\Monlist2.exe",
ProjectNumberFilePath = @"n:\Monlist2\projekte.txt",
UpdateInfoURL = "http://mtools/moni_updates.json",
Expand Down
6 changes: 3 additions & 3 deletions MONI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyProduct("moni 1.0.1.0")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyProduct("moni 1.0.2.0")]
27 changes: 11 additions & 16 deletions MONI/Util/AppHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,13 @@ private void ConfigureLogging()
var fileTarget = new FileTarget();
config.AddTarget("file", fileTarget);

ColoredConsoleTarget consoleTarget = null;
if (false)
{
consoleTarget = new ColoredConsoleTarget();
config.AddTarget("console", consoleTarget);
// Step 3. Set target properties
consoleTarget.Layout = "${longdate} ${level:uppercase=true} ${logger} ${message} ${exception:format=Message,Type,StackTrace:separator=//}";
}
// Step 3. Set target properties

#if DEBUG
var consoleTarget = new ColoredConsoleTarget();
consoleTarget.Layout = "${longdate} ${level:uppercase=true} ${logger} ${message} ${exception:format=Message,Type,StackTrace:separator=//}";
config.AddTarget("console", consoleTarget);
config.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, consoleTarget));

// check where we can write
if (Utils.CanCreateFile("."))
Expand All @@ -205,20 +204,16 @@ private void ConfigureLogging()
{
fileTarget.FileName = Utils.MoniAppDataPath() + "/logs/" + this.ApplicationName + ".${shortdate}.log";
}
#else
fileTarget.FileName = Utils.MoniAppDataPath() + "/logs/" + this.ApplicationName + ".${shortdate}.log";
#endif
fileTarget.KeepFileOpen = false;
fileTarget.CreateDirs = true;
fileTarget.ConcurrentWrites = true;
fileTarget.Layout = "${longdate} ${level:uppercase=true} ${logger} ${message} ${exception:format=Message,Type,StackTrace:separator=//}";

// Step 4. Define rules
if (consoleTarget != null)
{
var rule1 = new LoggingRule("*", LogLevel.Debug, consoleTarget);
config.LoggingRules.Add(rule1);
}

var rule2 = new LoggingRule("*", LogLevel.Debug, fileTarget);
config.LoggingRules.Add(rule2);
config.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, fileTarget));

// Step 5. Activate the configuration
LogManager.Configuration = config;
Expand Down
3 changes: 1 addition & 2 deletions MONI/Util/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public static bool CanCreateFile(string dir)

public static string MoniAppDataPath()
{
var appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
var moniAppData = Path.Combine(appData, "moni");
var moniAppData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "moni");
return moniAppData;
}

Expand Down
7 changes: 7 additions & 0 deletions moni_updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,11 @@
],
"DownLoadURL": "https://github.com/dotob/moni/releases/download/1.0.1/MONI.exe"
},
{
"Version": "1.0.2",
"Changes": [
"Update: Das Data und Log Verzeichnis ist jetzt beim ersten Start C:\Users\<User>\AppData\Roaming\moni\",
],
"DownLoadURL": "https://github.com/dotob/moni/releases/download/1.0.2/MONI.exe"
},
]

0 comments on commit 1836636

Please sign in to comment.