Exemplo n.º 1
0
    private static void OutPutLog(string msg, string loggerTypeL1 = null, string loggerTypeL2 = null, bool printfFunc = true, LogType logtype = LogType.Log)
    {
        StringBuilder stringBuilder = new StringBuilder();
        string        value         = string.Concat(new object[]
        {
            "[",
            DateTime.Now.Hour,
            ":",
            DateTime.Now.Minute,
            ":",
            DateTime.Now.Second,
            "_",
            DateTime.Now.Millisecond,
            "]"
        });

        stringBuilder.Append(value);
        bool flag = !string.IsNullOrEmpty(loggerTypeL1);

        if (flag)
        {
            stringBuilder.Append("[").Append(loggerTypeL1).Append("]");
        }
        bool flag2 = !string.IsNullOrEmpty(loggerTypeL2);

        if (flag2)
        {
            stringBuilder.Append("[").Append(loggerTypeL2).Append("]");
        }
        stringBuilder.Append("\t\t");
        stringBuilder.Append(msg);
        if (printfFunc)
        {
            string funcStackString = TLogger.GetFuncStackString();
            stringBuilder.Append(funcStackString);
        }
        TLogger.LogBuff.Enqueue(stringBuilder.ToString());
    }