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); }
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); }