예제 #1
0
        public static void Log(string msg, bool showMetadata = true)
        {
            Thread threadHandle = Thread.CurrentThread;
            string output       = msg;

            if (showMetadata)
            {
                output =
                    "[" + Time.GetTimestamp() + " | "
                    + Enum.GetName(typeof(ThreadId), Core.GetThreadId(Thread.CurrentThread)).ToUpper()
                    + "] " + msg;
            }

            Console.WriteLine(output);
            ConsoleWindow.WriteLine(output);

            if (Settings.logFiles.Length == 0)
            {
                return;
            }
            try
            {
                StreamWriter file = File.AppendText(Settings.logFiles[0]);
                file.WriteLine(output);
                file.Close();
            }
            catch (Exception) { }
        }
예제 #2
0
 public static void NewLine()
 {
     Console.WriteLine();
     ConsoleWindow.WriteLine("\n");
     if (Settings.logFiles.Length == 0)
     {
         return;
     }
     try
     {
         StreamWriter file = File.AppendText(Settings.logFiles[0]);
         file.WriteLine();
         file.Close();
     }
     catch (Exception) { }
 }
예제 #3
0
        public static void Debug(string msg)
        {
            string output = "[" + Time.GetTimestamp() + " | "
                            + "DEBUG" + "] " + msg;

            Console.WriteLine(output);
            ConsoleWindow.WriteLine(output);

            if (Settings.logFiles.Length == 0)
            {
                return;
            }
            try
            {
                StreamWriter file = File.AppendText(Settings.logFiles[0]);
                file.WriteLine(output);
                file.Close();
            }
            catch (Exception) { }
        }