mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 20:57:22 +02:00
another
This commit is contained in:
@@ -11,18 +11,20 @@ namespace Wox.Infrastructure.Logger
|
|||||||
{
|
{
|
||||||
public const string DirectoryName = "Logs";
|
public const string DirectoryName = "Logs";
|
||||||
|
|
||||||
|
public static string CurrentLogDirectory { get; private set; }
|
||||||
|
|
||||||
static Log()
|
static Log()
|
||||||
{
|
{
|
||||||
var path = Path.Combine(Constant.DataDirectory, DirectoryName, Constant.Version);
|
CurrentLogDirectory = Path.Combine(Constant.DataDirectory, DirectoryName, Constant.Version);
|
||||||
if (!Directory.Exists(path))
|
if (!Directory.Exists(CurrentLogDirectory))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(path);
|
Directory.CreateDirectory(CurrentLogDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
var configuration = new LoggingConfiguration();
|
var configuration = new LoggingConfiguration();
|
||||||
var target = new FileTarget();
|
var target = new FileTarget();
|
||||||
configuration.AddTarget("file", target);
|
configuration.AddTarget("file", target);
|
||||||
target.FileName = path.Replace(@"\", "/") + "/${shortdate}.txt";
|
target.FileName = CurrentLogDirectory.Replace(@"\", "/") + "/${shortdate}.txt";
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
var rule = new LoggingRule("*", LogLevel.Debug, target);
|
var rule = new LoggingRule("*", LogLevel.Debug, target);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user