Dispatcher
The CodeSite Dispatcher is the workhorse of the CodeSite Logging System, and
is responsible for dispatching CodeSite logging messages to their final destination
while it runs silently in the background. (On developer's machines, the Dispatcher
surfaces an icon in the system tray for access to settings and other tasks.)
There are two basic destinations for CodeSite messages: a CodeSite Live Viewer; and
a CodeSite Log File. However, these two destination types may reside either locally
or on a remote machine. Plus, there are several ways for the CodeSite Dispatcher to
transport messages to their final destination. The location of the viewer or log file
as well as the transport details to be used by the Dispatcher is contained in
a T|CodeSiteDestination instance, which the CodeSite Dispatcher receives from each
T|CodeSiteLogger instance.
In addition to its dispatching responsibilities, the CodeSite Dispatcher also allows
for dynamic blocking of selected CodeSite message types and even selected categories.
Furthermore, the Dispatcher manages a list of symbolic paths that can be referenced by
T|CodeSiteDestination objects. The Dispatcher also knows how to handle predefined
symbolic paths such as $(MyDocs) and $(AppExeDir).
Utilizing the CodeSite Dispatcher has several benefits. First, it minimizes the impact
the sending process has on your application. If the CodeSite Logging classes handled
writing the messages to the log file or sending them directly to the viewer, there would
be a significant impact on the performance of your application while the messages were
processed. Second, the Dispatcher takes care of synchronizing all of the messages.
This is absolutely crucial when using CodeSite in a multi-threaded situation, or if
you have multiple applications trying to log to the same file. Without the CodeSite
Dispatcher, the logging classes (or your own code) would need to perform appropriate
thread context switches and synchronization to prevent the log file from being corrupted.
The CodeSite Dispatcher is a core piece of the CodeSite Logging System and is part of the
CodeSite Tools, which means that it can be freely
redistributed to provide logging services on any system.
|