mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[Logger, Globals] Better vars/logging
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System.Reflection;
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
#if MONO
|
#if MONO
|
||||||
@@ -15,9 +16,9 @@ namespace SabreTools.Helper.Data
|
|||||||
|
|
||||||
private static Logger _logger = null;
|
private static Logger _logger = null;
|
||||||
private static int _maxDegreeOfParallelism = 4;
|
private static int _maxDegreeOfParallelism = 4;
|
||||||
private static string _exeDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase)
|
private static string _exeName = new Uri(Assembly.GetExecutingAssembly().GetName().CodeBase).LocalPath;
|
||||||
.Replace("file:", "")
|
private static string _exeDir = Path.GetDirectoryName(_exeName);
|
||||||
.TrimStart('\\');
|
private static string _args = string.Join(" ", Environment.GetCommandLineArgs());
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -49,6 +50,13 @@ namespace SabreTools.Helper.Data
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static string ExeName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _exeName;
|
||||||
|
}
|
||||||
|
}
|
||||||
public static string ExeDir
|
public static string ExeDir
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -56,6 +64,13 @@ namespace SabreTools.Helper.Data
|
|||||||
return _exeDir;
|
return _exeDir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static string CommandLineArgs
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _args;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace SabreTools.Helper
|
|||||||
_log.AutoFlush = true;
|
_log.AutoFlush = true;
|
||||||
|
|
||||||
_log.WriteLine("Logging started " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
_log.WriteLine("Logging started " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||||
_log.WriteLine(Environment.CommandLine);
|
_log.WriteLine(string.Format("Command run: {0}", Globals.CommandLineArgs));
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user