protected override string AppendNormal(L4j level, string title, string message) { if (!level.Polarity()) WriteBlankLine(); Write2Cols(ColorFor(level), title, message); if (!level.Polarity()) WriteBlankLine(); return GetText(); }
private ColorDescriptor ColorFor(L4j level) { switch (level) { case L4j.Fatal: return(_fatal ?? (_fatal = _doc.createColor(Color.Red))); case L4j.Error: return(_error ?? (_error = _doc.createColor(Color.Red))); case L4j.Warn: return(_warn ?? (_warn = _doc.createColor(Color.Yellow))); case L4j.Info: return(_info ?? (_info = _doc.createColor(Color.White))); case L4j.Debug: return(_debug ?? (_debug = _doc.createColor(Color.DarkGray))); case L4j.Trace: return(_trace ?? (_trace = _doc.createColor(Color.SlateGray))); case L4j.Off: return(_off ?? (_off = _doc.createColor(Color.Transparent))); default: throw Error.Unsupported(level); } }
private ColorDescriptor ColorFor(L4j level) { switch (level) { case L4j.Fatal: return _fatal ?? (_fatal = _doc.createColor(Color.Red)); case L4j.Error: return _error ?? (_error = _doc.createColor(Color.Red)); case L4j.Warn: return _warn ?? (_warn = _doc.createColor(Color.Yellow)); case L4j.Info: return _info ?? (_info = _doc.createColor(Color.White)); case L4j.Debug: return _debug ?? (_debug = _doc.createColor(Color.DarkGray)); case L4j.Trace: return _trace ?? (_trace = _doc.createColor(Color.SlateGray)); case L4j.Off: return _off ?? (_off = _doc.createColor(Color.Transparent)); default: throw Error.Unsupported(level); } }
private static void TestLevel(this ConsoleControl.ConsoleControl cons, L4j level) { cons.Write3Cols(GetColor(level), "SomeObjectAsSouce", "Testing [{0}] level".f(level), "This is a sampler of level {0}.".f(level)); }
protected override string AppendNormal(L4j level, string title, string message) { var p = _doc.addParagraph(); p.DefaultCharFormat.Font = _consolas; p.DefaultCharFormat.FontSize = 10.667F; p.DefaultCharFormat.FgColor = ColorFor(level); p.setText(Concat(title, message)); return _doc.render(); }
public void LogNormal(L4j level, string col1, string col2) { //if (!level.Polarity()) cons.BlankLine(); if (level == L4j.Error) cons.BlankLine(); cons.Write2Cols(ColorFor(level), col1, col2); //if (!level.Polarity()) cons.BlankLine(); if (level == L4j.Error) cons.BlankLine(); }
protected override string AppendNormal(L4j level, string title, string message) { var p = _doc.addParagraph(); p.DefaultCharFormat.Font = _consolas; p.DefaultCharFormat.FontSize = 10.667F; p.DefaultCharFormat.FgColor = ColorFor(level); p.setText(Concat(title, message)); return(_doc.render()); }
public static bool Polarity(this L4j level) { switch (level) { case L4j.Info: case L4j.Debug: case L4j.Trace: return(true); default: return(false); } }
protected override string AppendNormal(L4j level, string title, string message) { if (!level.Polarity()) { WriteBlankLine(); } Write2Cols(ColorFor(level), title, message); if (!level.Polarity()) { WriteBlankLine(); } return(GetText()); }
protected override Brush ColorFor(L4j level) { switch (level) { case L4j.Fatal : return Brushes.Red; case L4j.Error : return Brushes.Red; case L4j.Warn : return Brushes.Yellow; case L4j.Info : return Brushes.White; case L4j.Debug : return Brushes.DarkGray; case L4j.Trace : return Brushes.SlateGray; case L4j.Off : return Brushes.Transparent; default: throw Error.Unsupported(level, "color map"); } }
public void LogNormal(L4j level, string col1, string col2) { //if (!level.Polarity()) cons.BlankLine(); if (level == L4j.Error) { cons.BlankLine(); } cons.Write2Cols(ColorFor(level), col1, col2); //if (!level.Polarity()) cons.BlankLine(); if (level == L4j.Error) { cons.BlankLine(); } }
private static Color ColorFor(L4j level) { switch (level) { case L4j.Fatal: return(Color.Red); case L4j.Error: return(Color.Red); case L4j.Warn: return(Color.Yellow); case L4j.Info: return(Color.White); case L4j.Debug: return(Color.DarkGray); case L4j.Trace: return(Color.SlateGray); default: throw Error.Unsupported(level, "color map"); } }
private bool Arg(L4j level, ShowLogAs showAs, string title, string message) { if (level == L4j.Off) { return(false); } var e = new LogEventArg { Level = level, ShowAs = showAs, Title = title, Message = message }; try { _logAdded?.Invoke(this, e); } catch { } return(e.Level.Polarity()); }
protected override Brush ColorFor(L4j level) { switch (level) { case L4j.Fatal: return(Brushes.Red); case L4j.Error: return(Brushes.Red); case L4j.Warn: return(Brushes.Yellow); case L4j.Info: return(Brushes.White); case L4j.Debug: return(Brushes.DarkGray); case L4j.Trace: return(Brushes.SlateGray); case L4j.Off: return(Brushes.Transparent); default: throw Error.Unsupported(level, "color map"); } }
public void LogHeader(L4j level, string title, string subTitle) { cons.BlankLine(); cons.Write2Cols(ColorFor(level), title, subTitle); }
protected override string AppendHeader(L4j level, string title, string subTitle) { WriteBlankLine(); Write2Cols(ColorFor(level), title, subTitle); return(GetText()); }
protected abstract Brush ColorFor(L4j level);
protected override string AppendOutro(L4j level, string text) { WriteCol2of2(ColorFor(level), text); return GetText(); }
private NotificationType Notifier(L4j level) { return(new NotificationType(level.ToString(), $"Level : ‹{level}›")); }
public bool Normal_(L4j level, object title, object message, params object[] args) { return(Arg(level, ShowLogAs.Normal, title.ToString(), message.ToString().f(args))); }
protected abstract string AppendNormal(L4j level, string title, string message);
private static Color ColorFor(L4j level) { switch (level) { case L4j.Fatal: return Color.Red; case L4j.Error: return Color.Red; case L4j.Warn: return Color.Yellow; case L4j.Info: return Color.White; case L4j.Debug: return Color.DarkGray; case L4j.Trace: return Color.SlateGray; default: throw Error.Unsupported(level, "color map"); } }
protected abstract string AppendHeader (L4j level, string title, string subTitle);
protected override string AppendHeader(L4j level, string title, string message) { throw new NotImplementedException(); }
public void LogOutro(L4j level, string text) { cons.WriteLine(ColorFor(level), text); }
public void LogIntro(L4j level, string text) { cons.WriteCol1of2(ColorFor(level), text); }
protected abstract string AppendOutro(L4j level, string text);
public bool Intro_(L4j level, object title, params object[] args) { return(Arg(level, ShowLogAs.Intro, title.ToString().f(args), "")); }
protected abstract string AppendHeader(L4j level, string title, string subTitle);
public bool Outro_(L4j level, object message, params object[] args) { return(Arg(level, ShowLogAs.Outro, "", message.ToString().f(args))); }
protected override string AppendHeader(L4j level, string title, string subTitle) { WriteBlankLine(); Write2Cols(ColorFor(level), title, subTitle); return GetText(); }
protected abstract Brush ColorFor (L4j level);
protected abstract string AppendOutro (L4j level, string text);
protected override string AppendOutro(L4j level, string text) { WriteCol2of2(ColorFor(level), text); return(GetText()); }
protected override string AppendOutro(L4j level, string text) { throw new NotImplementedException(); }
protected abstract string AppendNormal (L4j level, string title, string message);