Click or drag to resize
LogMessage Class
Represents a log message that can be added to the Logger.
Inheritance Hierarchy

Namespace:  ABB.Robotics.RobotStudio
Assembly:  ABB.Robotics.RobotStudio (in ABB.Robotics.RobotStudio.dll) Version: 7.0.8747.636
Syntax
C#
public class LogMessage

The LogMessage type exposes the following members.

Constructors
  NameDescription
Public methodLogMessage(String)
Initializes a new instance of the LogMessage class with the specified message text.
Public methodLogMessage(String, LogMessageSeverity)
Initializes a new instance of the LogMessage class with the specified message text and severity.
Public methodLogMessage(String, String)
Initializes a new instance of the LogMessage class with the specified message text and category.
Public methodLogMessage(String, String, LogMessageSeverity)
Initializes a new instance of the LogMessage class with the specified message text, category and severity.
Public methodLogMessage(String, String, LogMessageSeverity, String)
Initializes a new instance of the LogMessage class with the specified message text, detailed text, category, severity and help topic.
Public methodLogMessage(String, String, String, LogMessageSeverity)
Initializes a new instance of the LogMessage class with the specified message text, category and severity.
Public methodLogMessage(String, String, String, LogMessageSeverity, String)
This constructor is for internal use only.
Top
Properties
  NameDescription
Public propertyCanActivate
Indicates if this message can be double-clicked to display more information.
Public propertyCategory
Gets the message category. This property is used to categorize log messages which is related to each other. A PowerPack for example, could define its own category for all messages that it logs.
Public propertyDetailedText
A more detailed description that if set to anything will be shown in a dialog when the message is activated.
Public propertyHelpTopic
This property is for internal use only.
Public propertySequenceNumber
Gets the sequence number of the message severity of the message.
Public propertySeverity
Gets the severity of the message. The severity is specified by the LogMessageSeverity enumerator.
Public propertyText
Gets the message text.
Public propertyTimeStamp
Gets the date and time when the message was logged.
Top
Methods
  NameDescription
Public methodEquals
Indicates whether the current object is equal to another object
(Overrides ObjectEquals(Object).)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode
Returns the hash code for this object.
(Overrides ObjectGetHashCode.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top
Events
  NameDescription
Public eventMessageActivated
Raised when this message is activated, e.g. double-clicked in the GUI.
Top
Remarks
This class can be used as it is, or it is possible to inherit from it to attach additional data to a log message.
Examples
Logger Example
Project.UndoContext.BeginUndoStep("Logger");
try
{
    // How to add categories to the Logger!
    // Add two categories.
    if (!Logger.CategoryCaptions.ContainsKey("MyKey"))
    {
        Logger.CategoryCaptions.Add("MyKey", "My Category");
        Logger.CategoryCaptions.Add("AnotherKey", "Another Category");
    }

    // Print a message in different categories.
    Logger.AddMessage(new LogMessage("This is just a test message!", "MyKey"));
    Logger.AddMessage(new LogMessage("This is just a test message!", "AnotherKey"));
}
catch
{
    Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
    throw;
}
finally
{
    Project.UndoContext.EndUndoStep();
}
Version Information

Supported in: 1.0.0.0
See Also