diff options
author | sr55 <[email protected]> | 2019-12-28 13:50:55 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2019-12-28 13:50:55 +0000 |
commit | 741d9e082ba0f40c4571f48b54eb237048df8c2a (patch) | |
tree | b851dad93de1cfae8aa127ef885cf8a3a347c425 /win/CS/HandBrakeWPF/Helpers | |
parent | 0ca1b03b3d3801b3db8661fd26e461ad2ca2e05f (diff) |
WinGui: First step in a long overdue cleanup of the logging code. Stripped out a bunch of unneeded code
Diffstat (limited to 'win/CS/HandBrakeWPF/Helpers')
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/LogManager.cs | 50 |
1 files changed, 5 insertions, 45 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/LogManager.cs b/win/CS/HandBrakeWPF/Helpers/LogManager.cs index 6a281fb64..429c5f971 100644 --- a/win/CS/HandBrakeWPF/Helpers/LogManager.cs +++ b/win/CS/HandBrakeWPF/Helpers/LogManager.cs @@ -11,62 +11,22 @@ namespace HandBrakeWPF.Helpers { using System.IO; - using HandBrake.Interop.Interop; + using Caliburn.Micro; + + using HandBrake.Worker.Logging.Models; using HandBrakeWPF.Utilities; using ILog = HandBrakeWPF.Services.Logging.Interfaces.ILog; - using LogService = HandBrakeWPF.Services.Logging.LogService; - /// <summary> - /// Tempory Class to Initialise the logging. - /// </summary> public static class LogManager { - /// <summary> - /// The init. - /// </summary> public static void Init() { - ILog log = LogService.GetLogger(); + ILog log = IoC.Get<ILog>(); string logDir = DirectoryUtilities.GetLogDirectory(); string logFile = Path.Combine(logDir, string.Format("activity_log{0}.txt", GeneralUtilities.ProcessId)); - if (!Directory.Exists(Path.GetDirectoryName(logFile))) - { - Directory.CreateDirectory(Path.GetDirectoryName(logFile)); - } - - log.Enable(); - log.SetupLogHeader(GeneralUtilities.CreateLogHeader().ToString()); - log.EnableLoggingToDisk(logFile, true); - HandBrakeUtils.MessageLogged += HandBrakeUtils_MessageLogged; - HandBrakeUtils.ErrorLogged += HandBrakeUtils_ErrorLogged; - } - - /// <summary> - /// Subscribe the ErrorLogged event. - /// </summary> - /// <param name="sender"> - /// The sender. - /// </param> - /// <param name="e"> - /// The e. - /// </param> - private static void HandBrakeUtils_ErrorLogged(object sender, HandBrake.Interop.Interop.EventArgs.MessageLoggedEventArgs e) - { - } - - /// <summary> - /// Subscribe the MessageLogged event. - /// </summary> - /// <param name="sender"> - /// The sender. - /// </param> - /// <param name="e"> - /// The e. - /// </param> - private static void HandBrakeUtils_MessageLogged(object sender, HandBrake.Interop.Interop.EventArgs.MessageLoggedEventArgs e) - { + log.ConfigureLogging(new LogHandlerConfig(true, logFile, true, GeneralUtilities.CreateLogHeader().ToString())); } } }
\ No newline at end of file |