Click or drag to resize
Logger Class
Provides methods and events to support logging of messages to the user.
Inheritance Hierarchy
SystemObject
  ABB.Robotics.RobotStudioLogger

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

The Logger type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberCategoryCaptions
Key-value pairs for translating category ids to (localized) texts.
Top
Methods
  NameDescription
Public methodStatic memberActivateMessage(LogMessage) Obsolete.
Fires the LogMessageActivated event.
Public methodStatic memberActivateMessage(Object, LogMessage)
Fires the LogMessageActivated and MessageActivated events and shows more details if the Handled is not True and the LogMessage is of base class type.
Public methodStatic memberAddMessage(String)
Adds an information log message to the logger.
Public methodStatic memberAddMessage(LogMessage)
Adds a log message to the logger.
Public methodStatic memberAddMessage(String, LogMessageSeverity)
Adds a log message to the logger.
Public methodStatic memberAddMessage(String, Boolean)
Adds an information log message to the logger.
Public methodStatic memberAddMessage(LogMessage, Boolean)
Adds a log message to the logger.
Public methodStatic memberClear
Clears the logger. All messages are removed.
Public methodStatic memberClear(String)
Removes all log messages with the specified category.
Public methodStatic memberGetMessages
Returns an all log messages in the logger.
Public methodStatic memberGetMessages(String)
Returns all log messages with the specified category.
Public methodStatic memberRemoveMessage
Removes a log message from the logger.
Top
Events
  NameDescription
Public eventStatic memberLogMessageActivated Obsolete.
Public eventStatic memberLogMessageAdded
Raised when a message is added.
Public eventStatic memberLogMessageRemoved
Raised when a message is removed.
Public eventStatic memberMessageActivated
Raised when a message is activated, e.g. double-clicked in the GUI.
Top
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