public void Write(LogEntry entry) { switch (entry.Severity) { case Severity.Error: ++errorCount; break; case Severity.Warning: ++warningCount; break; } Entries.Add(entry); }
public void Write(LogEntry entry) { switch (entry.Severity) { case Severity.Error: ++errorCount; break; case Severity.Warning : ++warningCount; break; #if !DIAGNOSTICS case Severity.Verbose: return; #endif } if (!string.IsNullOrEmpty(entry.Origin)) { Console.WriteLine(Date + GetSeverityName(entry.Severity) + ": " + entry.Origin + ": " + entry.Message); } else { Console.WriteLine(Date + GetSeverityName(entry.Severity) + ": " + entry.Message); } }
public void Write(LogEntry entry) { if (entry == null) { throw new ArgumentNullException("entry"); } switch (entry.Severity) { case Severity.Error: ++errorCount; break; case Severity.Warning: ++warningCount; break; } output.WriteLine( "{0}({1},{2}): {3} {4}: {5}", entry.Location.FilePath, entry.HLocation.FirstLine, entry.HLocation.FirstColumn, GetSeverityName(entry.Severity), entry.Code, entry.Message); }
public void Write(LogEntry entry) { var msg = MemberContext(entry) + entry.Message; switch (entry.Severity) { case Severity.Error: ++errorCount; logger.LogError(msg); break; case Severity.Message: ++warningCount; logger.LogMessage(msg); break; case Severity.Verbose: logger.LogVerbose(msg); break; case Severity.Warning: default: logger.LogWarning(msg); break; } }
public void Write(LogEntry entry) { throw new SyntaxException(entry.Location, entry.HLocation, entry.Message); }
private static string MemberContext(LogEntry entry) { if (string.IsNullOrEmpty(entry.Origin)) { return ""; } return entry.Origin + ": "; }
public IntSet UnicodeName(string name) { var result = IntSet.GetUnicodeCategory(name); if (result == null) { var entry = new LogEntry { Severity = Severity.Error, Message = string.Format("Invalid unicode category '{0}'.", name), }; entry.Location = Parsing.Location; entry.HLocation = Parsing.HLocation; Logging.Write(entry); return IntSet.Empty; } return result; }