From 9e9167bb63f14f176913cc42521d45639512c15a Mon Sep 17 00:00:00 2001 From: sr55 Date: Mon, 21 Mar 2016 00:07:04 +0000 Subject: WinGui: Add a Logging Service into the AppServices library. This does not depend on any 3rd party libraries and is off by default. It must be initialised by calling Enable() on the LogService class. Otherwise LogMessage does nothing. Changed the Logging screen to a single panel in the WinGui. This will change back to separate Scan/Encode logs when we get libhb it's own processes. Added Auto-Scroll to the log window. --- .../Interop/HandBrakePresetService.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs') diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs index fcc6d61da..7e1f95d3e 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs @@ -18,6 +18,7 @@ namespace HandBrake.ApplicationServices.Interop using HandBrake.ApplicationServices.Interop.Helpers; using HandBrake.ApplicationServices.Interop.Json.Presets; using HandBrake.ApplicationServices.Services.Logging; + using HandBrake.ApplicationServices.Services.Logging.Interfaces; using HandBrake.ApplicationServices.Services.Logging.Model; using Newtonsoft.Json; @@ -27,6 +28,8 @@ namespace HandBrake.ApplicationServices.Interop /// public class HandBrakePresetService { + private static readonly ILog log = LogService.GetLogger(); + /// /// The get built in presets. /// Requires an hb_init to have been invoked. @@ -39,7 +42,7 @@ namespace HandBrake.ApplicationServices.Interop IntPtr presets = HBFunctions.hb_presets_builtin_get_json(); string presetJson = Marshal.PtrToStringAnsi(presets); - LogHelper.LogMessage(new LogMessage(presetJson, LogMessageType.progressJson, LogLevel.debug)); + log.LogMessage(presetJson, LogMessageType.API, LogLevel.Debug); IList presetList = JsonConvert.DeserializeObject>(presetJson); @@ -60,7 +63,7 @@ namespace HandBrake.ApplicationServices.Interop IntPtr presetStringPointer = HBFunctions.hb_presets_read_file_json(InteropUtilities.ToUtf8PtrFromString(filename)); string presetJson = Marshal.PtrToStringAnsi(presetStringPointer); - LogHelper.LogMessage(new LogMessage(presetJson, LogMessageType.libhb, LogLevel.debug)); + log.LogMessage(presetJson, LogMessageType.API, LogLevel.Debug); PresetTransportContainer preset = JsonConvert.DeserializeObject(presetJson); -- cgit v1.2.3