public override void AppendMessage(string message, IssueLevel issueLevel, DateTime date) { var output = this.MessageFormatter.FormatMessage(message, issueLevel, date); this.writer.WriteLine(output); this.writer.Flush(); }
public IssueType(Exception exception, IssueLevel issueLevel) { Message = exception.Message; StackTrace = exception.StackTrace; IssueLevel = issueLevel; ExceptionTypeName = exception.GetType().ToString(); Inner = exception.InnerException != null ? new IssueType(exception.InnerException, issueLevel) : null; }
public IssueType(string message, IssueLevel issueLevel) { Message = message; StackTrace = null; IssueLevel = issueLevel; ExceptionTypeName = null; Inner = null; }
public Issue(Object target, IssueLevel level, string message, string solution = "", string solutionURL = "") { this.target = target; this.level = level; this.message = message; this.solution = solution; this.solutionURL = solutionURL; }
private void LogAnMessage(string message, IssueLevel issueLevel) { var date = DateTime.Now; foreach (var item in this.MessageAppenders) { item.AppendMessage(message, issueLevel, date); } }
/// <summary> /// Initializes a new <see cref="ComponentIssue"/> instance with the given parameters. /// </summary> /// <param name="component">The <see cref="IComponent"/> instance the issue relates to.</param> /// <param name="level">The severity level of the issue.</param> /// <param name="message">A message describing the issue.</param> /// <param name="supportUrl">A URL containing support information.</param> public ComponentIssue(IComponent component, IssueLevel level, string message, string supportUrl) { Debug.Assert(message != null); this.Component = component; this.Level = level; this.Message = message; this.SupportUrl = supportUrl; }
private string GetResultLog(ValidationResult[] results, IssueLevel level) { var log = ""; foreach (var result in results) { log += result.GetResultLog(true, level) + Environment.NewLine; } return(log); }
public string FormatMessage(string message, IssueLevel issueLevel, DateTime date) { StringBuilder output = new StringBuilder(); output.AppendLine("<log>"); output.AppendLine(string.Format("{0}<message>{1}</message>", tabulation, message)); output.AppendLine(string.Format("{0}<issueLevel>{1}</issueLevel>", tabulation, issueLevel)); output.AppendLine(string.Format("{0}<date>{1}</date>", tabulation, date)); output.AppendLine("</log>"); return output.ToString(); }
public string FormatMessage(string message, IssueLevel issueLevel, DateTime date) { StringBuilder output = new StringBuilder(); output.AppendLine("<log>"); output.AppendLine(string.Format("{0}<message>{1}</message>", tabulation, message)); output.AppendLine(string.Format("{0}<issueLevel>{1}</issueLevel>", tabulation, issueLevel)); output.AppendLine(string.Format("{0}<date>{1}</date>", tabulation, date)); output.AppendLine("</log>"); return(output.ToString()); }
public IssueType(string exceptionTypeName, string message, string stackTrace, IssueLevel issueLevel, IInnerIssueType inner, IEnumerable <IIssue> issues, int ticket, string responseMessage) { _exceptionTypeName = exceptionTypeName; _message = message; _stackTrace = stackTrace; _issueLevel = issueLevel; _inner = inner; _issues = issues.ToList(); _ticket = ticket; ResponseMessage = responseMessage; }
public string FormatMessage(string message, IssueLevel issueLevel, DateTime date) { StringBuilder output = new StringBuilder(); output.AppendLine("{"); output.AppendLine(string.Format("{0}\"message\" : \"{1}\"", tabulation, message)); output.AppendLine(string.Format("{0}\"issueLevel\" : \"{1}\"", tabulation, issueLevel)); output.AppendLine(string.Format("{0}\"date\" : \"{1}\"", tabulation, date)); output.AppendLine("}"); return(output.ToString()); }
private MessageType GetMessageType(IssueLevel level) { switch (level) { case IssueLevel.Info: return(MessageType.Info); case IssueLevel.Warning: return(MessageType.Warning); case IssueLevel.Error: return(MessageType.Error); case IssueLevel.Fatal: return(MessageType.Error); default: return(MessageType.None); } }
public static string GetIssueClass(IssueLevel state) { switch (state) { case IssueLevel.Info: return("info"); case IssueLevel.Error: return("danger"); case IssueLevel.Warning: return("warning"); } return("secondary"); }
/// <summary> /// ルールチェック結果に指定されたレベル以上のIssueが存在するかチェックする。 /// </summary> public bool HasValidationIssues(IssueLevel level) { if (validationResults != null) { foreach (var result in validationResults) { foreach (var issue in result.Issues) { if (issue.level >= level) { return(false); } } } } return(true); }
public ILogResponse RegisterIssue(Exception exception, IssueLevel issueLevel) { throw new NotImplementedException(); //TODO: Register internal issues in quilt4, using quilt4 //var registerIssueRequest = new RegisterIssueRequest //{ // Id = Guid.NewGuid(), // Session = new Tharga.Quilt4Net.DataTransfer.Session { }, // ClientTime = DateTime.UtcNow, // //Data = exception.Data.ToDictionary<string,string>(x => x.key,x => x.value), // //IssueThreadGuid = // UserInput = null, // VisibleToUser = false, // UserHandle = null, // IssueType = new Tharga.Quilt4Net.DataTransfer.IssueType(), //}; //var response = RegisterIssue(registerIssueRequest); //throw new NotImplementedException(); return(new LogResponse(null, null, null)); }
public static void PostIssue(string message, IssueLevel level) { issues.Add(new Issue(message, level)); //TODO: show these in the interface StreamWriter write = null; try { write = new StreamWriter(new FileStream(logfile, FileMode.Append)); write.WriteLine(level.ToString() + ": " + message); } catch (IOException) { } finally { if (write != null) write.Close(); } }
public static void PostIssue(string message, IssueLevel level) { issues.Add(new Issue(message, level)); //TODO: show these in the interface StreamWriter write = null; try { write = new StreamWriter(new FileStream(logfile, FileMode.Append)); write.WriteLine(level.ToString() + ": " + message); } catch (IOException) { } finally { if (write != null) { write.Close(); } } }
/// <summary> /// 検証ログを取得する。 /// </summary> /// <param name="level">指定したレベル以上のログを出力する。</param> /// <returns>ログテキスト</returns> public string GetResultLog(bool issueLogs = true, IssueLevel level = IssueLevel.Info) { if (!issueLogs && string.IsNullOrEmpty(resultLog)) { return(""); } var log = string.Format("# {0}", RuleName) + Environment.NewLine; log += resultLog; if (issueLogs && Issues.Count > 0) { foreach (var issue in Issues) { if (issue.level < level) { continue; } var levelMark = GetLevelMark(issue); var issueLog = levelMark + issue.message + Environment.NewLine; if (issue.target != null) { issueLog += string.Format("({0})", issue.target.name) + Environment.NewLine; } if (!string.IsNullOrEmpty(issue.solution)) { issueLog += issue.solution + Environment.NewLine; } if (!string.IsNullOrEmpty(issue.solutionURL)) { issueLog += issue.solutionURL + Environment.NewLine; } log += issueLog + Environment.NewLine; } } return(log); }
/// <summary> /// Initializes a new <see cref="ComponentIssue"/> instance with the given parameters. /// </summary> /// <param name="component">The <see cref="IComponent"/> instance the issue relates to.</param> /// <param name="level">The severity level of the issue.</param> /// <param name="message">A message describing the issue.</param> public ComponentIssue(IComponent component, IssueLevel level, string message) : this(component, level, message, null) { }
public Issue(string message, IssueLevel level) { this.message = message; this.level = level; Console.WriteLine(message); }
public Issue(IssueLevel level, string content, string addition = "") { Level = level; Content = content; Addition = addition; }
public string FormatMessage(string message, IssueLevel issueLevel, DateTime date) { return(string.Format("{0} - {1} - {2}", message, issueLevel, date)); }
public Issue(IssueLevel level, string message, params object[] args) { Level = level; Message = string.Format(message, args); }
public string ToConsoleString() => $"{FileName}({StartLine},{StartColumn}-{EndColumn}): {IssueLevel.ToString().ToLower()}: {Message}";
public abstract void AppendMessage(string message, IssueLevel issueLevel, DateTime date);
/// <summary> /// Initializes a new <see cref="ComponentIssue"/> instance with the given parameters. /// </summary> /// <param name="component">The <see cref="IComponent"/> instance the issue relates to.</param> /// <param name="level">The severity level of the issue.</param> /// <param name="message">A message describing the issue.</param> /// <param name="supportUrl">A URL containing support information.</param> public ComponentIssue( IComponent component, IssueLevel level, string message, string supportUrl ) { Debug.Assert( message != null ); this.Component = component; this.Level = level; this.Message = message; this.SupportUrl = supportUrl; }
public override void AppendMessage(string message, IssueLevel issueLevel, DateTime date) { var output = this.MessageFormatter.FormatMessage(message, issueLevel, date); Console.WriteLine(output); }
public string FormatMessage(string message, IssueLevel issueLevel, DateTime date) { return string.Format("{0} - {1} - {2}", message, issueLevel, date); }
public Issue(ScriptDom.TSqlFragment fragment, IssueLevel level, string message) { _fragment = fragment; _level = level; _message = message; }
public override void AppendMessage(string message, IssueLevel issueLevel, DateTime date) { string output = this.MessageFormatter.FormatMessage(message, issueLevel, date); this.ListBox.Items.Add(output); }
/// <summary> /// Initializes a new <see cref="ComponentIssue"/> instance with the given parameters. /// </summary> /// <param name="component">The <see cref="IComponent"/> instance the issue relates to.</param> /// <param name="level">The severity level of the issue.</param> /// <param name="message">A message describing the issue.</param> public ComponentIssue( IComponent component, IssueLevel level, string message ) : this(component, level, message, null) { }
public Issue(IssueLevel level) { Level = level; }