Ejemplo n.º 1
0
        public static void Write(string message, LogType type = LogType.DEBUG, string fileName = "")
        {
            if (_logLevel == 0 && type == LogType.DEBUG)
            {
                return;
            }

            try
            {
                StreamWriter sw = new StreamWriter(GetLogFilePath(type, fileName), true);
                sw.WriteLine(
                    string.Format("{0} [{1}] \r\n{2}",
                                  type.ToLocalString(),
                                  DateTime.Now.ToString(),
                                  message));
                sw.WriteLine(GetSeparatorStr());
                sw.Close();
            }
            catch { }
        }