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); }
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); } }
//============================ // Fixed Method. //============================ public void SetChannel(LOGGER_CHANNEL channel, bool value) { if (channel == LOGGER_CHANNEL.NUM || !hasInited) { return; } _enableChannel[(int)channel] = value; }
//------------------------------------------- public void EnableChannel(LOGGER_CHANNEL channel, bool isEnabled) { if (!hasInited) { return; } if (channel == LOGGER_CHANNEL.NUM) { return; } _enabledChannel[(int)channel] = isEnabled; }