Create FancyLogger opt-in/out mechanism#8178
Conversation
Added FancyLogger (in development). Used with the /fancylogger commandline switch
e583016 to
fc46e3f
Compare
Renamed to a more descriptive name and replaced undisplayable characters with \|/-
Co-authored-by: Rainer Sigwald <[email protected]>
Default scrolling is disabled for the alternate buffer. Instead, it responds to up/down arrow keys for scrolling and rendering automatically
Targets are shown and marked as complete with checkmark and green color when finished
Calculated as completedTasks / existingTasks
Created class to encapsulate information and hierarchy of build events with their corresponding buffer line ids, and methods for expanding / collapsing (wip)
2280a64 to
62da1ea
Compare
rainersigwald
left a comment
There was a problem hiding this comment.
I really, really want the deferred messages for details on why the new logger is not used despite the opt-in but would be ok with a follow-up PR adding that.
…tly. Reviewed comments
It is added now :D |
Forgind
left a comment
There was a problem hiding this comment.
You should get rid of testing.txt, but this looks pretty good to me overall, minus stylistic nits 🙂
| @@ -0,0 +1,221 @@ | |||
| using System; | |||
| if (FancyLoggerBuffer.AutoScrollEnabled) break; | ||
| } | ||
| FancyLoggerBuffer.Terminate(); | ||
| Console.WriteLine("Build status, warnings and errors will be shown here after the build has ended and the interactive logger has closed"); |
There was a problem hiding this comment.
This looks like it should be localized eventually ™️
| AutoScrollEnabled = true; | ||
| // Render contents | ||
| WriteTitleBar(); | ||
| WriteFooter("This is an empty footer haha"); |
There was a problem hiding this comment.
| WriteFooter("This is an empty footer haha"); | |
| WriteFooter("This is an empty footer hoho"); |
Gotta get in the Christmas spirit!
| #region Writing | ||
| public static void WriteTitleBar() | ||
| { | ||
| Console.Write("" |
There was a problem hiding this comment.
Why do you have to start there with "" + ? Could you just start with ANSIBuilder.Cursor.Home()?
| new ParameterlessSwitchInfo( new string[] { "filelogger8", "fl8" }, ParameterlessSwitch.FileLogger8, null), | ||
| new ParameterlessSwitchInfo( new string[] { "filelogger9", "fl9" }, ParameterlessSwitch.FileLogger9, null), | ||
| new ParameterlessSwitchInfo( new string[] { "distributedfilelogger", "dfl" }, ParameterlessSwitch.DistributedFileLogger, null), | ||
| new ParameterlessSwitchInfo( new string[] { "fancylogger", "flg" }, ParameterlessSwitch.FancyLogger, null), |
There was a problem hiding this comment.
Do we want to make this a True/False thing so we can switch the default opt in/opt out behavior at some point?
Fixes #
Context
For the average user, the current ConsoleLogger does not provide the required amount of information about the build, as it either shows too little information (with low verbosity levels) or too much information that it is very difficult to find (with high verbosity levels).
A better approach would be having the log update to show the necessary amount of information for the current performing action (be it a project, target or task) and hiding additional data for actions that completed successfully; thus reducing the amount of irrelevant info.
Likewise the addition of formatting (bold, italics, color) using ANSI escape codes provides the user with a much better experience.
A progress tracker for the build is also considered.
Changes Made
FancyLoggerclass.ANSIBuilderstatic class with helper methods for ANSI formatting and graphics/fancyloggerand/flgcommand line switches for enabling the FancyLogger$MSBUILDFANCYLOGGERenvironment variable for enabling the FancyLoggerTesting
Notes