示例#1
0
    public override void OnMessage(LogEntry entry)
    {
        m_mutex.EnterMutex();

        string time = TimeUtil.FormatTime(entry.time);
        string file = System.IO.Path.GetFileName(entry.file);

        StringBuilder sb = new StringBuilder();

        sb.Append("[").Append(m_whoami).Append("]");
        sb.Append(" ").Append(time);
        sb.Append(" [").Append(Log.ToString(entry.level)).Append("]");
        sb.Append(" [").Append(file).Append(":").Append(entry.line).Append("] ");
        sb.Append(entry.message).Append("\n");

        Console.WriteLine(sb.ToString().Replace("\n", "\n\t"));

        m_mutex.LeaveMutex();
    }