DisplayMagician/DisplayMagicianShared/SharedLogger.cs
Terry MacDonald dd8939b395 Logging changes
Combined DisplayMagicianShared logging into
the main log file to simplify log reporting for the
future. Also started adding info and debug
statements to the program to make the debug
level log work well for troubleshooting. This is
going to take a LONG time to complete, but will
be worth it in the end.
2021-02-10 22:40:22 +13:00

29 lines
1018 B
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace DisplayMagicianShared
{
public class SharedLogger
{
internal static string AppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "DisplayMagician");
internal static string AppLogPath = Path.Combine(AppDataPath, $"Logs");
internal static string AppSettingsFile = Path.Combine(AppDataPath, $"Settings_1.0.json");
public static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
/// <summary>
/// Provides a way of passing the NLog Logger instance to the DisplayMagician.Shared library so we log to a single log file.
/// </summary>
/// <param name="parentLogger"></param>
public SharedLogger(NLog.Logger parentLogger)
{
SharedLogger.logger = parentLogger;
}
}
}