summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-03-21 00:07:04 +0000
committersr55 <[email protected]>2016-03-21 00:07:04 +0000
commit9e9167bb63f14f176913cc42521d45639512c15a (patch)
treec62ab72125805ee252ac96fdb6c78154c5c9d1fc /win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
parent78827728072257daadc8acb00bb24af7779c4d63 (diff)
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.
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
index 3540bb368..ef98f3f86 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
@@ -11,7 +11,6 @@ namespace HandBrake.ApplicationServices.Interop
{
using System;
using System.Collections.Generic;
- using System.Diagnostics;
using System.Runtime.InteropServices;
using HandBrake.ApplicationServices.Interop.EventArgs;
@@ -19,6 +18,7 @@ namespace HandBrake.ApplicationServices.Interop
using HandBrake.ApplicationServices.Interop.Json.Anamorphic;
using HandBrake.ApplicationServices.Interop.Json.Shared;
using HandBrake.ApplicationServices.Services.Logging;
+ using HandBrake.ApplicationServices.Services.Logging.Interfaces;
using HandBrake.ApplicationServices.Services.Logging.Model;
using Newtonsoft.Json;
@@ -28,6 +28,8 @@ namespace HandBrake.ApplicationServices.Interop
/// </summary>
public static class HandBrakeUtils
{
+ private static readonly ILog log = LogService.GetLogger();
+
/// <summary>
/// The callback for log messages from HandBrake.
/// </summary>
@@ -301,7 +303,7 @@ namespace HandBrake.ApplicationServices.Interop
public static Geometry GetAnamorphicSize(AnamorphicGeometry anamorphicGeometry)
{
string encode = JsonConvert.SerializeObject(anamorphicGeometry, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
- LogHelper.LogMessage(new LogMessage(encode, LogMessageType.encodeJson, LogLevel.debug));
+ log.LogMessage(encode, LogMessageType.API, LogLevel.Debug);
IntPtr json = HBFunctions.hb_set_anamorphic_size_json(Marshal.StringToHGlobalAnsi(encode));
string result = Marshal.PtrToStringAnsi(json);
return JsonConvert.DeserializeObject<Geometry>(result);
@@ -317,10 +319,9 @@ namespace HandBrake.ApplicationServices.Interop
{
if (MessageLogged != null)
{
+ log.LogMessage(message, LogMessageType.ScanOrEncode, LogLevel.Info);
MessageLogged(null, new MessageLoggedEventArgs(message));
}
-
- Debug.WriteLine(message);
}
/// <summary>
@@ -333,10 +334,9 @@ namespace HandBrake.ApplicationServices.Interop
{
if (ErrorLogged != null)
{
+ log.LogMessage(message, LogMessageType.ScanOrEncode, LogLevel.Error);
ErrorLogged(null, new MessageLoggedEventArgs(message));
}
-
- Debug.WriteLine("ERROR: " + message);
}
}
}