public Logger(string title, Color titleColor, FontStyle titleStyle = FontStyle.Normal) { Title = title; TitleColor = titleColor; TitleStyle = titleStyle; _richTextFactory = new RichTextFactory(2048); TitleBacked = _richTextFactory .Style(TitleStyle).Color(TitleColor).Text(Title) .ToString(true); }
private Logger(string prefix, string title, Color titleColor, FontStyle titleStyle = FontStyle.Normal) { Title = title; TitleColor = titleColor; TitleStyle = titleStyle; _richTextFactory = new RichTextFactory(2048); TitleBacked = _richTextFactory .UnstyledText(prefix) .Style(TitleStyle).Color(TitleColor).Text(Title) .ToString(true); }
public static string CreateExceptionMessageForRoutine(Routine routine, Exception exception) { var creationStackTrace = routine.GetCreationStackTraceInternal(); var messageFactory = RichTextFactory.New(exception.Message.Length + 200) .Text("Exception thrown inside routine ▸ ").Bold.Text(exception.GetType().ToString()) .NewLine.Italic.Text("ROUTINE TYPE ▸ ").UnstyledText(routine.GetType().Namespace).UnstyledText(".") .Bold.Text(routine.GetType().Name) .NewLine.UnstyledText("▾ ▾ ▾ ▾ ▾") .NewLine.Bold.Text("▸ ▸ ▸ EXCEPTION ◂ ◂ ◂") .NewLine.UnstyledText(exception.Message) .NewLine .NewLine.Bold.Text("▸ ▸ ▸ STACK TRACE ◂ ◂ ◂") .NewLine.UnstyledText(StackTraceUtility.ExtractStringFromException(exception)); messageFactory.NewLine.Bold.Text("▸ ▸ ▸ CREATION STACK TRACE ◂ ◂ ◂"); messageFactory.NewLine.UnstyledText( string.IsNullOrEmpty(creationStackTrace) ? "You can call CreationStackTrace method at routine to show creation stack trace" : creationStackTrace); return(messageFactory.ToString()); }