Represents a multiplexing logger. The purpose of this logger is to register and unregister multiple loggers during the build. Supports the Visual Studio IDE scenario in which loggers are registered and unregistered for each project system's build request. One physical build can have multiple logical builds, each with its own set of loggers.
MuxLogger registers itself with the build manager as a regular central /l style logger. It receives messages from the build manager and routes them to the correct logger, based on the logical build that the message came from.
public ref class MuxLogger : Microsoft::Build::Framework::INodeLogger
public class MuxLogger : Microsoft.Build.Framework.INodeLogger
type MuxLogger = class interface INodeLogger interface ILogger
Public Class MuxLogger Implements INodeLogger
MuxLogger generally functions as follows:
MuxLoggeris registered at the beginning of the build manager's Begin build.
Any loggers registered before the build manager starts the build get the build-started event at the same time as the
Any loggers registered after the build manager starts the build get a synthesized build-started event. The event cannot be cached because the timestamp of the build-started event is determined when the event is created, and caching the event would give incorrect build times in the loggers registered to the
MuxLoggeris initialized by the build manager
MuxLoggerlistens to all events on the event source from the build manager and routes events correctly to the registered loggers.
MuxLoggeris shutdown when the build is finished in end build. At this time, it unregisters any loggers attached to it.
MuxLoggerlogs the build-finished event when the project-finished event for the first project-started event is seen for each logger.
MuxLogger registers loggers in the following way:
The logger is passed to the
MuxLogger.RegisterLoggermethod with a submission ID that is used to route a message to that logger.
MuxLoggerregisters the logger to the
If the build-started event has already been logged, the
MuxLoggercreates a new build-started event and sends it to the logger's event source.
MuxLogger unregisters loggers in the following way:
When a build submission is completed, the
MuxLogger.UnregisterLoggermethod is called with the submission ID for the logger.
MuxLoggerlooks up the success state of the project-finished event for the submission ID and logs a build-finished event to the logger.
MuxLoggercleans up the event source.
Note that the unregister comes from a thread other than the logging thread and a synchronization issue could occur if unregister is called while events are being logged.
Creates a new instance of the multiplexing logger.
Gets or sets the Parameters attribute, required by the
Gets or sets the Verbosity attribute, required by the
Determines whether the specified object is equal to the current object.(Inherited from Object)
Serves as the default hash function.(Inherited from Object)
Gets the Type of the current instance.(Inherited from Object)
Creates a shallow copy of the current Object.(Inherited from Object)
Registers a logger on the
Shuts down the
Returns a string that represents the current object.(Inherited from Object)
Removes the specified logger from the MuxLogger.