public void WriteLine(ImportanceLevel importance, string format, params object[] segments) { if (importance >= this.importance) { Console.WriteLine("[{0}]:\t{1}", importance, string.Format(format, segments)); } }
public static string GetCssClass(ImportanceLevel imp, bool withpreDash) { string res = ""; if (withpreDash) { res = "-"; } switch (imp) { case ImportanceLevel.Formal: return(string.Empty); case ImportanceLevel.Minor: return(res + "info"); case ImportanceLevel.Major: return(res + "warning"); case ImportanceLevel.Fatal: return(res + "danger"); case ImportanceLevel.NeedHumanReview: default: return(string.Empty); } }
public ActivationThreshold( ImportanceLevel metricThreshold, LogEventLevel textualThreshold) { Metric = metricThreshold; Textual = textualThreshold; }
public ActivationItem( ImportanceLevel metricThreshold, LogEventLevel textualThreshold, IEnumerable <ActivationFilter> filters) { Threshold = new ActivationThreshold(metricThreshold, textualThreshold); Filters = filters?.ToArray() ?? Array.Empty <ActivationFilter>(); }
public ActivationExtend( ImportanceLevel importance, string componentTag, IEnumerable <ActivationFilter> filters) { Importance = importance; Filters = filters?.ToArray() ?? Array.Empty <ActivationFilter>(); }
public ActivationSetting( ImportanceLevel metricThreshold, LogEventLevel textualThreshold, IEnumerable <ActivationItem> constricts, IEnumerable <ActivationItem> extends) : base(/*metricThreshold, textualThreshold, */ constricts, extends) { Threshold = new ActivationThreshold(metricThreshold, textualThreshold); }
public ActivationSetting( ImportanceLevel minImportance, IEnumerable <ActivationConstrict> constricts, IEnumerable <ActivationExtend> extends) { MinImportance = minImportance; Constricts = constricts?.ToArray() ?? Array.Empty <ActivationConstrict>(); Extends = extends?.ToArray() ?? Array.Empty <ActivationExtend>(); }
public static void StartBlock(string line, ImportanceLevel importance = ImportanceLevel.Debug) { if (importance < MinimalImportanceLevel) { NestingLevel++; return; } Debug.WriteLine("┃".Repeat(++NestingLevel - 1) + $"┏{line}"); }
public static void FinishBlock(string line, ImportanceLevel importance = ImportanceLevel.Debug) { if (importance < MinimalImportanceLevel) { NestingLevel--; return; } Debug.WriteLine("┃".Repeat(NestingLevel-- - 1) + $"┗{line}"); }
public Logger(ImportanceLevel il, string fileName) { working = true; importance = il; log = new Thread(new ThreadStart(LogMessage)); log.Priority = ThreadPriority.Lowest; //log.Start(); this.fileName = fileName; WriteLine(ImportanceLevel.Warning, "Logger started"); }
private void Alarm(ImportanceLevel _level) { //显示出新的任务:假如上个任务完成,则只显示开始、跳过;假如上个任务未完成,则显示完成、终止,然后再显示开始和跳过 //震动提示 switch (_level) { case ImportanceLevel.Soft: Debug.Log(taskList[curTaskIndex].TaskString); break; } }
/// <summary> /// Counts the specified importance. /// </summary> /// <param name="importance">The importance.</param> /// <param name="tags">The tags.</param> /// <param name="count">The count.</param> public void Count( ImportanceLevel importance, IReadOnlyDictionary <string, string> tags, int count) { if (_activation.IsActive(importance)) { tags = _tags.AddRange(tags ?? ImmutableDictionary <string, string> .Empty) .AddRange(_tagContext.Tags ?? ImmutableDictionary <string, string> .Empty); _influxClient.Increment(_measurementName, count, tags: tags); } }
/// <summary> /// Reports the specified fields. /// </summary> /// <param name="fields">The fields.</param> /// <param name="tags">The tags.</param> /// <param name="importance">The importance.</param> public void Report( IReadOnlyDictionary <string, object> fields, IReadOnlyDictionary <string, string> tags, ImportanceLevel importance) { if (_activation.IsActive(importance)) { var contextTags = tags = _tags.AddRange(tags ?? ImmutableDictionary <string, string> .Empty) .AddRange(_tagContext.Tags ?? ImmutableDictionary <string, string> .Empty); _influxClient.Write(_measurementName, fields, tags); } }
/// <summary> /// Report operation duration. /// </summary> /// <param name="importance">The importance.</param> /// <param name="tags">The tags.</param> /// <returns></returns> public IDisposable Duration( ImportanceLevel importance, IReadOnlyDictionary <string, string> tags) { IDisposable result = NonDisposable.Default; if (_activation.IsActive(importance)) { tags = _tags.AddRange(tags ?? ImmutableDictionary <string, string> .Empty) .AddRange(_tagContext.Tags ?? ImmutableDictionary <string, string> .Empty); result = _influxClient.Time(_measurementName, tags: tags); } return(result); }
public static void Log(string line, ImportanceLevel importance = ImportanceLevel.Debug) { if (importance < MinimalImportanceLevel) { return; } if (NestingLevel == 0) { Debug.WriteLine(line); } else { Debug.WriteLine("┃".Repeat(NestingLevel - 1) + $"┣[{importance}]{line}"); } }
/// <summary> /// Determines whether the specified metric level is active. /// </summary> /// <param name="metricLevel">The metric level.</param> /// <returns> /// <c>true</c> if the specified metric level is active; otherwise, <c>false</c>. /// </returns> public bool IsActive( ImportanceLevel metricLevel) { if (metricLevel < _setting.MinImportance) { #region Check if pass the extends foreach (var extend in _setting.Extends) { var settingImportance = extend.Importance; if (settingImportance > metricLevel) { continue; // won't activate anyway } var tokenSupportAllFilters = extend.Filters.All(m => _activationContext.HasToken(m.Path)); if (tokenSupportAllFilters) { return(true); // both important and filters match } } return(false); #endregion // If(Extend) true } #region Check if constricted foreach (var constrict in _setting.Constricts) { var settingImportance = constrict.Importance; if (settingImportance < metricLevel) { continue; // activate anyway } var tokenSupportAllFilters = constrict.Filters.All(m => _activationContext.HasToken(m.Path)); if (tokenSupportAllFilters) { return(false); // both important and filters match } } #endregion // Check if constricted return(true); }
public void ShowMessage(ImportanceLevel level, string message, string title = null) { switch (level) { case ImportanceLevel.Error: MessageDialogHelper.RunErrorDialog(message, title); break; case ImportanceLevel.Warning: MessageDialogHelper.RunWarningDialog(message, title); break; case ImportanceLevel.Info: default: MessageDialogHelper.RunInfoDialog(message, title); break; } }
public void ShowMessage(ImportanceLevel level, string message, string title = null) { switch (level) { case ImportanceLevel.Info: logger.Info(message); break; case ImportanceLevel.Warning: logger.Warn(message); break; case ImportanceLevel.Error: logger.Error(message); break; default: break; } }
public static string IssuesByLevelQuery(ImportanceLevel importanceLevel) { List <string> sb = new List <string>(); string logical = " OR "; string key = "issues.issueTypeId:{0}"; foreach (int iss in Enum.GetValues(typeof(Issues.IssueType.IssueTypes))) { if (IssueType.IssueImportance(iss) == importanceLevel) { sb.Add(string.Format(key, iss)); } } if (sb.Count == 0) { return(string.Empty); } else { return("( " + sb.Aggregate((f, s) => f + logical + s) + " )"); } }
public void ShowMessage(ImportanceLevel level, string message, string title = null) { interactiveMessage.ShowMessage(ImportanceLevel.Info, message, title); }
/// <summary> /// Determines whether the specified metric level is active. /// </summary> /// <param name="level">The metric level.</param> /// <returns> /// <c>true</c> if the specified metric level is active; otherwise, <c>false</c>. /// </returns> public bool IsActive( ImportanceLevel level) { return(IsActive((int)level, TelemetryActivationKind.Metric)); }
} //DataBase-den Userleri Statusuna uygun filtirlemeq ve List qaytarmaq public List <TodoEntity> GetAll(ImportanceLevel importanceLevel) { return(_todoDal.GetAll(importanceLevel)); } //DataBase-den Userleri ImportanceLevel uygun filtirlemeq ve List qaytarmaq
/// <summary> /// Report quantity at point in time. /// Classic usage is for reporting operation starts /// from this kind of report you can understand the throughput over the time-line. /// </summary> /// <param name="importance">The importance.</param> /// <param name="tags">The tags.</param> public void Count( ImportanceLevel importance, IReadOnlyDictionary <string, string> tags) { Count(importance, tags, 1); }
} //DataBase-den Userleri Statusuna uygun filtirlemeq ve List qaytarmaq public List <TodoEntity> GetAll(ImportanceLevel importanceLevel) { return(_todoEntities.Where(i => i.ImportanceLevel == importanceLevel).ToList()); } //DataBase-den Userleri ImportanceLevel uygun filtirlemeq ve List qaytarmaq
public static string GetIcon(ImportanceLevel imp, string sizeInCss = "90%;", string glyphiconSymbol = "exclamation-sign") { string res = "<span class=\"text{0} glyphicon glyphicon-{3}\" style=\"font-size:{1}\" aria-hidden=\"true\" title=\"{2}\"></span>"; return(string.Format(res, GetCssClass(imp, true), sizeInCss, imp.ToNiceDisplayName(), glyphiconSymbol)); }
public abstract void Write (string msg, ImportanceLevel level);
public MinimalImportanceScope(ImportanceLevel importance) { _previousMinimalImportanceLevel = MinimalImportanceLevel; MinimalImportanceLevel = importance; }
public override void Write (string tag, string msg, ImportanceLevel importance) { int v = Log.VerboseLevel; switch (v) { case 0 : break; case 1 : if (importance >= ImportanceLevel.HIGH) { DoWrite (tag, msg); } break; case 2 : if (importance >= ImportanceLevel.MEDIUM) { DoWrite (tag, msg); } break; case 3 : DoWrite (tag, msg); break; default: break; } }
public void Write (string tag, string msg, ImportanceLevel importance) { foreach (ILogger logger in consumers) { if (tag == null || tag == "") { logger.Write (msg, importance); } else { logger.Write (tag, msg, importance); } } }
public void Write (string msg, ImportanceLevel importance) { Write (null, msg, importance); }
public abstract void Write (string tag, string msg, ImportanceLevel importance);
public AndroidChannel(string id, string name, ImportanceLevel importance) { this.Id = id; this.Name = name; this.Importance = importance; }
public AndroidChannel(string id, string name, ImportanceLevel importance) { Id = id; Name = name; Importance = importance; }
public InfoFact(string txt, ImportanceLevel level) { this.Text = txt; this.Level = level; }
public static void Log(object obj, ImportanceLevel importance = ImportanceLevel.Debug) { Log(obj.ToString()); }