Example #1
0
 public zPACKET(string data, zLEVEL level)       /*{{{
                                                  */
 {
     this.When  = DateTime.Now;
     this.Data  = data;
     this.Level = level;
 }       /*}}}*/
Example #2
0
        }                                                   /*}}}*/

        public static void write(string data, zLEVEL level) /*{{{
                                                             */
        {
            if (zlog.isQuit)
            {
                return;
            }

            // Determine if this thread have Name?
            string threadName = "";

            if (Thread.CurrentThread.Name != null)
            {
                threadName = Thread.CurrentThread.Name.Trim();
            }
            if (threadName.Length > 0)
            {
                threadName = "{" + threadName + "} ";
            }

            // Build log Packet and Enqueue to Master Thread
            zPACKET pk = new zPACKET(threadName + data, level);

            pk.isWriteFile    = isWriteFile;
            pk.isWriteConsole = isWriteConsole;
            pk.isWriteClient  = isWriteClient;
            pk.isWriteServer  = isWriteServer;
            lock (queMaster.SyncRoot) { queMaster.Enqueue(pk); }
        }       /*}}}*/