MonoDevelop's logging system provides a mechanism for AddIns to report errors and warnings that can assist in tracking down bugs or unexpected behaviour. It can also be used to log incidental information that may be of interest to the user, and debugging information for more detailed analysis of the MonoDevelop's internal behaviour.
The defined logging levels are, in descending order of importance,
For the purpose of specifying logging levels that should be reported, the self-explanatory levels All and None are defined. Also defined are UpToFatal, UpToError, UpToWarn, UpToInfo and UpToDebug, which correspond to all levels with importance equal to or greater than the named levels.
The console logger is the most important logger for identifying the cause of major problems, as it is enabled by default and its output will survive a major crash. The logging level defaults to UpToWarn, and can be set with the environment variable MONODEVELOP_CONSOLE_LOG_LEVEL.
Although the messages can be colour-coded in order to aid visual identification of the different levels, this feature has been known to cause unusual console behaviour and hence is disabled by default. It can be enabled by setting the environment variable MONODEVELOP_CONSOLE_LOG_USE_COLOUR=True.
MonoDevelop's Logging API is accessible via the static MonoDevelop.Core.LoggingService class, but most of the implementation details are in the namespace MonoDevelop.Core.Logging. It maintains a collection of ILogger-implementing loggers and broadcasts log messages to them.
The basic logging call is Log (LogLevel level, string message). For convenience, the following methods log with preset logging levels
each offering the overloads
New ILoggers may be implemented and added to the LoggingService with a call to AddLogger (ILogger logger). Each logger's Name property must be unique among the registered loggers, so that they can be accessed by name with ILogger GetLogger (string name) and unregistered with void RemoveLogger (string name).