/// <summary>Adds the log entry.</summary> /// <param name="x">The line to add.</param> public void AddLogEntry (LogLine x) { maxModNameLength = System.Math.Max (maxModNameLength, x.ModuleName.Length); lock (linesToProcess) linesToProcess.Enqueue (x); }
/// <summary> /// Adds the log entry. /// </summary> /// <param name="level">Level.</param> /// <param name="moduleName">Module name.</param> /// <param name="status">Status code.</param> /// <param name="additionalMessage">Additional message.</param> /// <param name="args">Arguments.</param> public void AddLogEntry(LogLevel level, string moduleName, Status status, string additionalMessage = null, params object[] args) { var fd = StatusDescription.Descriptions[status]; var x = new LogLine{ LogLevel = level, ModuleName = moduleName, Format = (additionalMessage ?? "Code: Status." + status + "\n" + fd), Param = args, Timestamp = DateTime.Now }; AddLogEntry(x); }
/// <summary>Adds the log entry.</summary> /// <param name="level">The level.</param> /// <param name="moduleName">Name of the module.</param> /// <param name="format">Message.</param> /// <param name="args">The arguments.</param> public void AddLogEntry (LogLevel level, string moduleName, string format, params object[] args) { var x = new LogLine { LogLevel = level, ModuleName = moduleName, Format = format, Param = args, Timestamp = DateTime.Now }; AddLogEntry (x); }