Пример #1
0
        public void Log(string msg, LOGGER_CHANNEL channel, bool simpleMode)
        {
            if (!hasInited)
            {
                return;
            }
            if (_enabledChannel[(int)channel] == false)
            {
                return;
            }
            string outputMsg;

            if (simpleMode)
            {
                outputMsg = msg;
            }
            else
            {
                outputMsg =
                    "(at " + DateTime.Now.ToString() + ")" +
                    "[" + channel.ToString() + "]" + msg;
            }
            foreach (TILoggerListener listener in _listeners)
            {
                listener.log(outputMsg);
            }
            Console.WriteLine(outputMsg);
        }
Пример #2
0
        public void Log(string msg, LOGGER_CHANNEL channel)
        {
            if (!hasInited)
            {
                return;
            }

            if (_enableChannel[(int)channel] == false)
            {
                return;
            }

            string outMsg;

            if (LoggerPrintMode == LOGGER_PRINTMODE.ADVANCED)
            {
                outMsg = "[" + System.DateTime.Now.ToString() + "]" + channel.ToString() + ":" + msg;
            }
            else
            {
                outMsg = msg;
            }

            for (int i = 0; i < _listener.Count; i++)
            {
                _listener[i].Log(outMsg, channel);
            }
        }
Пример #3
0
        //============================
        // Fixed Method.
        //============================
        public void SetChannel(LOGGER_CHANNEL channel, bool value)
        {
            if (channel == LOGGER_CHANNEL.NUM || !hasInited)
            {
                return;
            }

            _enableChannel[(int)channel] = value;
        }
Пример #4
0
 //-------------------------------------------
 public void EnableChannel(LOGGER_CHANNEL channel, bool isEnabled)
 {
     if (!hasInited)
     {
         return;
     }
     if (channel == LOGGER_CHANNEL.NUM)
     {
         return;
     }
     _enabledChannel[(int)channel] = isEnabled;
 }