OSDN Git Service

CLI: update the built in presets
[handbrake-jp/handbrake-jp-git.git] / win / C# / HandBrake.ApplicationServices / Functions / Logging.cs
1 /*  Logging.cs $\r
2     This file is part of the HandBrake source code.\r
3     Homepage: <http://handbrake.fr>.\r
4     It may be used under the terms of the GNU General Public License. */\r
5 \r
6 namespace HandBrake.ApplicationServices.Functions\r
7 {\r
8     using System;\r
9     using System.IO;\r
10     using System.Text;\r
11     using System.Windows.Forms;\r
12 \r
13     using HandBrake.ApplicationServices.Model;\r
14 \r
15     /// <summary>\r
16     /// The System Information.\r
17     /// </summary>\r
18     public class Logging\r
19     {\r
20         /// <summary>\r
21         /// Add the CLI Query to the Log File.\r
22         /// </summary>\r
23         /// <param name="encJob">\r
24         /// The Encode Job Object\r
25         /// </param>\r
26         /// <returns>\r
27         /// The create cli log header.\r
28         /// </returns>\r
29         public static string CreateCliLogHeader(Job encJob)\r
30         {\r
31             StringBuilder logHeader = new StringBuilder();\r
32 \r
33             logHeader.AppendLine(String.Format("# {0}", Init.HandBrakeGuiVersionString));\r
34             logHeader.AppendLine(String.Format("# Running: {0}", Environment.OSVersion));\r
35             logHeader.AppendLine(String.Format("# CPU: {0}", SystemInfo.GetCpuCount));\r
36             logHeader.AppendLine(String.Format("# Ram: {0} MB", SystemInfo.TotalPhysicalMemory));\r
37             logHeader.AppendLine(String.Format("# Screen: {0}x{1}", SystemInfo.ScreenBounds.Bounds.Width, SystemInfo.ScreenBounds.Bounds.Height));\r
38             logHeader.AppendLine(String.Format("# Temp Dir: {0}", Path.GetTempPath()));\r
39             logHeader.AppendLine(String.Format("# Install Dir: {0}", Application.StartupPath));\r
40             logHeader.AppendLine(String.Format("# Data Dir: {0}\n", Application.UserAppDataPath));\r
41 \r
42             if (encJob != null)\r
43             {\r
44                 logHeader.AppendLine(String.Format("# CLI Query: {0}", encJob.Query));\r
45                 logHeader.AppendLine(String.Format("# User Query: {0}", encJob.CustomQuery));\r
46             }\r
47             logHeader.AppendLine("-------------------------------------------");\r
48 \r
49             return logHeader.ToString();\r
50         }\r
51     }\r
52 }