diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/Helpers/LogManager.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/LogManager.cs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/LogManager.cs b/win/CS/HandBrakeWPF/Helpers/LogManager.cs new file mode 100644 index 000000000..4e883f8ee --- /dev/null +++ b/win/CS/HandBrakeWPF/Helpers/LogManager.cs @@ -0,0 +1,49 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="LogManager.cs" company="HandBrake Project (http://handbrake.fr)"> +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// </copyright> +// <summary> +// The log manager. +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Helpers +{ + using System; + using System.IO; + + using HandBrake.ApplicationServices.Interop; + using HandBrake.ApplicationServices.Services.Logging; + using HandBrake.ApplicationServices.Services.Logging.Interfaces; + + using HandBrakeWPF.Utilities; + + /// <summary> + /// Tempory Class to Initialise the logging. + /// </summary> + public static class LogManager + { + /// <summary> + /// The init. + /// </summary> + public static void Init() + { + ILog log = LogService.GetLogger(); + string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs"; + string logFile = Path.Combine(logDir, string.Format("activity_log{0}.txt", GeneralUtilities.ProcessId)); + log.Enable(); + log.SetupLogHeader(GeneralUtilities.CreateLogHeader().ToString()); + log.EnableLoggingToDisk(logFile, true); + HandBrakeUtils.MessageLogged += HandBrakeUtils_MessageLogged; + HandBrakeUtils.ErrorLogged += HandBrakeUtils_ErrorLogged; + } + + private static void HandBrakeUtils_ErrorLogged(object sender, HandBrake.ApplicationServices.Interop.EventArgs.MessageLoggedEventArgs e) + { + } + + private static void HandBrakeUtils_MessageLogged(object sender, HandBrake.ApplicationServices.Interop.EventArgs.MessageLoggedEventArgs e) + { + } + } +}
\ No newline at end of file |