Ejemplo n.º 1
0
        public void Print(string log, HTMLDebugCategory debugInfo, bool printOnGlobal)
        {
            if (this.LogOnlyErrors && (!this.LogOnlyErrors || debugInfo != HTMLDebugCategory.Error) && (!this.LogOnlyErrors || debugInfo != HTMLDebugCategory.Warning))
            {
                return;
            }
            HTMLDebugData htmlDebugData = new HTMLDebugData(log, debugInfo);

            lock (this._logQueue)
                this._logQueue.Enqueue(htmlDebugData);
            if (!printOnGlobal)
            {
                return;
            }
            Debug.Print(log);
        }
Ejemplo n.º 2
0
        private bool DoLoggingJob()
        {
            bool          flag          = false;
            HTMLDebugData htmlDebugData = (HTMLDebugData)null;

            lock (this._logQueue)
            {
                if (this._logQueue.Count > 0)
                {
                    htmlDebugData = this._logQueue.Dequeue();
                }
            }
            if (htmlDebugData != null)
            {
                flag = true;
                htmlDebugData.Print(this._fileStream, Logger._logFileEncoding);
                if ((htmlDebugData.Info == HTMLDebugCategory.Error || htmlDebugData.Info == HTMLDebugCategory.Warning) && this._writeErrorsToDifferentFile)
                {
                    htmlDebugData.Print(this._errorsFileStream, Logger._logFileEncoding, false);
                }
            }
            return(flag);
        }