/// <summary> /// 错误 /// </summary> static public void Error(string msg) { if (m_LogLv > eLogLevel.LV_ERROR) { return; } if (!m_EnableType[(int)eLogLevel.LV_ERROR]) { return; } string log = "[error]" + msg; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(log); Console.ForegroundColor = ConsoleColor.White; Console.WriteLine(Utils.GetStackTrace()); if (m_Log2File) { Log4Helper.Error(log); } if (m_MsgFun != null) { m_MsgFun(log); } }
/// <summary> /// 错误 /// </summary> static public void Error(params string[] msg) { if (m_LogLv > eLogLevel.LV_ERROR) { return; } if (!m_EnableType[(int)eLogLevel.LV_ERROR]) { return; } tmp_st.Clear(); for (int i = 0; i < msg.Length; ++i) { tmp_st = tmp_st.Append(msg[i]); } string log = "[error]" + tmp_st.ToString(); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(log); Console.ForegroundColor = ConsoleColor.White; if (m_Log2File) { Log4Helper.Error(log); } if (m_MsgFun != null) { m_MsgFun(log); } }