Exemplo n.º 1
0
        public void Write(object source, LogPrio priority, string message)
        {
            switch (priority)
            {
                case LogPrio.Trace:
                    MainConsole.Instance.Format(new log4net.Core.Level(0, "None"), "[{0}]: {1}", source, message);
                    break;
                case LogPrio.Debug:
                    MainConsole.Instance.Format(new log4net.Core.Level(0, "None"), "[{0}]: {1}", source, message);
                    break;
                case LogPrio.Error:
                    MainConsole.Instance.ErrorFormat("[{0}]: {1}", source, message);
                    break;
                case LogPrio.Info:
                    MainConsole.Instance.InfoFormat("[{0}]: {1}", source, message);
                    break;
                case LogPrio.Warning:
                    MainConsole.Instance.WarnFormat("[{0}]: {1}", source, message);
                    break;
                case LogPrio.Fatal:
                    MainConsole.Instance.ErrorFormat("[{0}]: FATAL! - {1}", source, message);
                    break;
            }

            return;
        }
Exemplo n.º 2
0
//        private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        public void Write(object source, LogPrio priority, string message)
        {
            /*
            switch (priority)
            {
                case LogPrio.Trace:
                    m_log.DebugFormat("[{0}]: {1}", source, message);
                    break;
                case LogPrio.Debug:
                    m_log.DebugFormat("[{0}]: {1}", source, message);
                    break;
                case LogPrio.Error:
                    m_log.ErrorFormat("[{0}]: {1}", source, message);
                    break;
                case LogPrio.Info:
                    m_log.InfoFormat("[{0}]: {1}", source, message);
                    break;
                case LogPrio.Warning:
                    m_log.WarnFormat("[{0}]: {1}", source, message);
                    break;
                case LogPrio.Fatal:
                    m_log.ErrorFormat("[{0}]: FATAL! - {1}", source, message);
                    break;
                default:
                    break;
            }
            */

            return;
        }
Exemplo n.º 3
0
        public void Write(object source, LogPrio priority, string message)
        {
            switch (priority)
            {
                case LogPrio.Trace:
                    m_log.Format (new log4net.Core.Level (0, "None"), "[{0}]: {1}", source, message);
                    break;
                case LogPrio.Debug:
                    m_log.Format(new log4net.Core.Level(0, "None"), "[{0}]: {1}", source, message);
                    break;
                case LogPrio.Error:
                    m_log.ErrorFormat("[{0}]: {1}", source, message);
                    break;
                case LogPrio.Info:
                    m_log.InfoFormat("[{0}]: {1}", source, message);
                    break;
                case LogPrio.Warning:
                    m_log.WarnFormat("[{0}]: {1}", source, message);
                    break;
                case LogPrio.Fatal:
                    m_log.ErrorFormat("[{0}]: FATAL! - {1}", source, message);
                    break;
                default:
                    break;
            }

            return;
        }