Пример #1
0
        public void Write(string message, LoggerLevels level)
        {
            //skip messages that are outside of our logging scope
            if (level > LoggerLevel)
            {
                return;
            }

            //log the message
            try
            {
                File.AppendAllText(LogFilePath,
                                   string.Format("{0} -- {1} -- {2}{3}",
                                                 DateTime.Now.ToString(),
                                                 level.ToString(),
                                                 message, Environment.NewLine));
            }
            catch { }
        }
Пример #2
0
        public void Write(string message, LoggerLevels level)
        {
            //skip messages that are outside of our logging scope
            if (level > LoggerLevel) return;

            //log the message
            try
            {
                File.AppendAllText(LogFilePath,
                    string.Format("{0} -- {1} -- {2}{3}",
                        DateTime.Now.ToString(),
                        level.ToString(),
                        message, Environment.NewLine));
            }
            catch { }
        }