Skip to content

Commit 1b0ed75

Browse files
authored
Rename terminallogger docs and update with more details (#9010)
These in-repo docs for TerminalLogger are likely to be hit when searching, so they need to be up to date and referring to the latest names.
1 parent 2d1952d commit 1b0ed75

File tree

2 files changed

+38
-19
lines changed

2 files changed

+38
-19
lines changed

documentation/livelogger/Opt-In-Mechanism.md

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# TerminalLogger Opt-in
2+
3+
## When should we use TerminalLogger
4+
5+
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.
6+
7+
## Proposal
8+
9+
### Enabling for a single build
10+
11+
Using the `/terminallogger` or `/tl` command line switches, users are able to opt-in and use the TerminalLogger, EXCEPT when:
12+
13+
- The terminal does not support ANSI codes or color
14+
- Output is redirected to a file or pipe
15+
16+
### Enabling for all builds
17+
18+
Users can set the `MSBUILDLIVELOGGER` environment variable to enable TerminalLogger without adding a swtich to all build invocations.
19+
20+
### TerminalLogger parameters
21+
22+
Both methods accept parameters:
23+
24+
- `true` forces TerminalLogger to be used even wwhen it would be disabled
25+
- `false` forces TerminalLogger to not be used even when it would be enabled
26+
- `auto` enables TerminalLogger when the terminal supports it and the session doesn't have redirected stdout/stderr
27+
28+
In cases where the TerminalLogger should not be enabled, the default ConsoleLogger should be used instead.
29+
30+
## Considerations
31+
32+
### Should TerminalLogger be used with other loggers (eg, BinaryLogger, FileLogger, custom loggers)?
33+
34+
TerminalLogger should only replace the current ConsoleLogger for the aforementioned cases. Additionally, other loggers can be used in conjunction.
35+
36+
### Should output be ignored with the `/noconsolelogger` flag enabled?
37+
38+
TerminalLogger serves as a replacement for ConsoleLogger, so it should behave similarly. When attaching the `/noconsolelogger` flag, it should not output anything.

0 commit comments

Comments
 (0)