From 632f05b616f9e3d9930069b4c23ede751271d3df Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Tue, 11 Jul 2023 12:12:10 -0500 Subject: [PATCH] Rename terminallogger docs and update with more details --- documentation/livelogger/Opt-In-Mechanism.md | 19 ---------- .../terminallogger/Opt-In-Mechanism.md | 38 +++++++++++++++++++ 2 files changed, 38 insertions(+), 19 deletions(-) delete mode 100644 documentation/livelogger/Opt-In-Mechanism.md create mode 100644 documentation/terminallogger/Opt-In-Mechanism.md diff --git a/documentation/livelogger/Opt-In-Mechanism.md b/documentation/livelogger/Opt-In-Mechanism.md deleted file mode 100644 index ca9c558fde8..00000000000 --- a/documentation/livelogger/Opt-In-Mechanism.md +++ /dev/null @@ -1,19 +0,0 @@ -# When should we use LiveLogger - -The LiveLogger presents the user with the build's most relevant information at the time, automatically hiding all the information that is no longer relevant (as to prevent huge log outputs). However, many users might find this not very useful (or even counterproductive) such as those using a terminal without proper ANSI support or when redirecting the output to a file. For that reason, the users must be able to turn this feature on/off at will. - -# Proposal -Using the `/livelogger` or `/ll` command line switches, users are able to opt-in and use the LiveLogger, EXCEPT when: -- The terminal does not support ANSI codes or color - - Output is redirected to a file or pipe - -For early development stages, an environment variable `$MSBUILDLIVELOGGER` should be enabled to prevent accidental access to an unfinished feature. - -In cases where the LiveLogger should not be enabled, the default ConsoleLogger should be used instead. - -# Considerations -## Should LiveLogger be used with other loggers (eg, BinaryLogger, FileLogger, custom loggers)? -LiveLogger should only replace the current ConsoleLogger for the aforementioned cases. Additionally, other loggers can be used in conjunction. - -## Should output be ignored with the `/noconsolelogger` flag enabled? -LiveLogger serves as a replacement for ConsoleLogger, so it should behave similarly. When attaching the `/noconsolelogger` flag, it should not output anything. diff --git a/documentation/terminallogger/Opt-In-Mechanism.md b/documentation/terminallogger/Opt-In-Mechanism.md new file mode 100644 index 00000000000..2092a1feaba --- /dev/null +++ b/documentation/terminallogger/Opt-In-Mechanism.md @@ -0,0 +1,38 @@ +# TerminalLogger Opt-in + +## When should we use TerminalLogger + +The TerminalLogger presents the user with the build's most relevant information at the time, automatically hiding all the information that is no longer relevant (as to prevent huge log outputs). However, many users might find this not very useful (or even counterproductive) such as those using a terminal without proper ANSI support or when redirecting the output to a file. For that reason, the users must be able to turn this feature on/off at will. + +## Proposal + +### Enabling for a single build + +Using the `/terminallogger` or `/tl` command line switches, users are able to opt-in and use the TerminalLogger, EXCEPT when: + +- The terminal does not support ANSI codes or color +- Output is redirected to a file or pipe + +### Enabling for all builds + +Users can set the `MSBUILDLIVELOGGER` environment variable to enable TerminalLogger without adding a swtich to all build invocations. + +### TerminalLogger parameters + +Both methods accept parameters: + +- `true` forces TerminalLogger to be used even wwhen it would be disabled +- `false` forces TerminalLogger to not be used even when it would be enabled +- `auto` enables TerminalLogger when the terminal supports it and the session doesn't have redirected stdout/stderr + +In cases where the TerminalLogger should not be enabled, the default ConsoleLogger should be used instead. + +## Considerations + +### Should TerminalLogger be used with other loggers (eg, BinaryLogger, FileLogger, custom loggers)? + +TerminalLogger should only replace the current ConsoleLogger for the aforementioned cases. Additionally, other loggers can be used in conjunction. + +### Should output be ignored with the `/noconsolelogger` flag enabled? + +TerminalLogger serves as a replacement for ConsoleLogger, so it should behave similarly. When attaching the `/noconsolelogger` flag, it should not output anything.