Ejemplo n.º 1
0
        public static void LogCalculateEngineConnections(string IP, string message, Enums.LogLevel logLevel)
        {
            try
            {
                if (!File.Exists(path4))
                {
                    using (FileStream fs = File.Create(path4))
                    {
                        fs.Close();
                    }
                }

                using (StreamWriter writter = File.AppendText(path4))
                {
                    writter.Write(DateTime.Now + "   " + IP + "   " + logLevel.ToString() + "   " + message + "\r\n");
                    writter.Close();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
        }
Ejemplo n.º 2
0
        public static void LogSimulatorValues(string IP, string message, Enums.LogLevel logLevel, int value)
        {
            try
            {
                if (!File.Exists(path3))
                {
                    using (FileStream fs = File.Create(path3))
                    {
                        fs.Close();
                    }
                }

                using (StreamWriter writter = File.AppendText(path3))
                {
                    writter.Write(DateTime.Now + "   " + IP + "  " + logLevel.ToString() + "   " + message + value + " bytes." + "\r\n");
                    writter.Close();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
        }
Ejemplo n.º 3
0
        public static void LogGeneratorValues(string message, Enums.GeneratorType generatorType, Enums.LogLevel logLevel, float value)
        {
            try
            {
                if (!File.Exists(path2))
                {
                    using (FileStream fs = File.Create(path2))
                    {
                        fs.Close();
                    }
                }

                using (StreamWriter writter = File.AppendText(path2))
                {
                    writter.Write(DateTime.Now + "   " + generatorType.ToString() + " " + logLevel.ToString() + " Value:  " + value + "\r\n");
                    writter.Close();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
        }
Ejemplo n.º 4
0
        public static void Log(string message, Enums.Component component, Enums.LogLevel logLevel)
        {
            try
            {
                if (!File.Exists(path))
                {
                    using (FileStream fs = File.Create(path))
                    {
                        fs.Close();
                    }
                }

                using (StreamWriter writter = File.AppendText(path))
                {
                    writter.Write(DateTime.Now + " << " + component.ToString() + " >> [" + logLevel.ToString() + "] -> " + message + "\r\n");
                    writter.Close();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.StackTrace);
            }
        }