1 // --------------------------------------------------------------------------------------------------------------------
2 // <copyright file="ILog.cs" company="HandBrake Project (http://handbrake.fr)">
3 //   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
4 // </copyright>
5 // <summary>
6 //   Defines the ILog type.
7 // </summary>
8 // --------------------------------------------------------------------------------------------------------------------
9 
10 namespace HandBrakeWPF.Services.Logging.Interfaces
11 {
12     using System;
13     using System.Collections.Generic;
14 
15     using HandBrakeWPF.Model.Logging;
16 
17     using LogEventArgs = EventArgs.LogEventArgs;
18 
19     public interface ILog : IDisposable
20     {
21         /// <summary>
22         /// The message logged.
23         /// </summary>
24         event EventHandler<LogEventArgs> MessageLogged;
25 
26         /// <summary>
27         /// The log reset event
28         /// </summary>
29         event EventHandler LogReset;
30 
31         /// <summary>
32         /// An ID that allows this instance to be associated with an encode service implementation.
33         /// </summary>
34         int LogId { get; }
35 
36         /// <summary>
37         /// The filename this log service is outputting to.
38         /// </summary>
39         string FileName { get; }
40 
41         /// <summary>
42         /// Enable logging for this worker process.
43         /// </summary>
44         /// <param name="filename">
45         /// The filename.
46         /// </param>
47         /// <param name="fullLogPath">
48         /// The full Log Path.
49         /// </param>
50         /// <remarks>
51         /// If this is not called, all log messages from libhb will be ignored.
52         /// </remarks>
ConfigureLogging(string filename, string fullLogPath)53         void ConfigureLogging(string filename, string fullLogPath);
54 
55         /// <summary>
56         /// Log a message.
57         /// </summary>
58         /// <param name="content">
59         /// The content of the log message,
60         /// </param>
LogMessage(string content)61         void LogMessage(string content);
62 
GetFullLog()63         string GetFullLog();
64 
GetLogMessages()65         List<LogMessage> GetLogMessages();
66 
67         /// <summary>
68         /// Empty the log cache and reset the log handler to defaults.
69         /// </summary>
Reset()70         void Reset();
71 
72         /// <summary>
73         /// Add a Marker to this log service to make it easier to associate with an encode instance.
74         /// </summary>
75         /// <param name="id">An ID number from the underlying service.</param>
SetId(int id)76         void SetId(int id);
77     }
78 }