コード例 #1
0
 public static void EndLine(LogFilePath logFilePath)
 {
     using (StreamWriter writer = new StreamWriter(logFilePath.path, true))
     {
         writer.WriteLine(endLine);
     }
 }
コード例 #2
0
 public static void Minimal(LogFilePath logFilePath, string line)
 {
     using (StreamWriter writer = new StreamWriter(logFilePath.path, true))
     {
         writer.WriteLine(line);
     }
 }
コード例 #3
0
 public static void InfoLine(LogFilePath logFilePath, MethodBase caller = null)
 {
     using (StreamWriter writer = new StreamWriter(logFilePath.path, true))
     {
         writer.WriteLine(getInfoLineString(caller));
     }
 }
コード例 #4
0
 public static void Error(LogFilePath logFilePath, Exception ex, MethodBase caller = null)
 {
     using (StreamWriter writer = new StreamWriter(logFilePath.path, true))
     {
         writer.WriteLine(getInfoLineString(caller));
         writer.WriteLine("Message: " + ex.Message);
         writer.WriteLine("Stacktrace: " + ex.StackTrace);
         writer.WriteLine(endLine);
     }
 }
コード例 #5
0
 public static void GameStarted(LogFilePath logFilePath)
 {
     using (StreamWriter writer = new StreamWriter(logFilePath.path, false))
     {
         for (int i = 0; i <= 3; i++)
         {
             writer.WriteLine(Regex.Replace(endLine, Environment.NewLine, ""));
         }
         writer.WriteLine(DateTime.Now.ToString() + ": Game started");
         writer.WriteLine(endLine);
     }
 }
コード例 #6
0
        public static void Block(LogFilePath logFilePath, string[] lines, MethodBase caller = null)
        {
            using (StreamWriter writer = new StreamWriter(logFilePath.path, true))
            {
                writer.WriteLine(getInfoLineString(caller));

                foreach (string line in lines)
                {
                    writer.WriteLine(line);
                }

                writer.WriteLine(endLine);
            }
        }