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); } }