Logger Class |
Namespace: ABB.Robotics.RobotStudio
public static class Logger
The Logger type exposes the following members.
Name | Description | |
---|---|---|
CategoryCaptions |
Key-value pairs for translating category ids to (localized) texts.
|
Name | Description | |
---|---|---|
ActivateMessage(LogMessage) | Obsolete.
Fires the LogMessageActivated event.
| |
ActivateMessage(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.
| |
AddMessage(String) |
Adds an information log message to the logger.
| |
AddMessage(LogMessage) |
Adds a log message to the logger.
| |
AddMessage(String, LogMessageSeverity) |
Adds a log message to the logger.
| |
AddMessage(String, Boolean) |
Adds an information log message to the logger.
| |
AddMessage(LogMessage, Boolean) |
Adds a log message to the logger.
| |
Clear |
Clears the logger. All messages are removed.
| |
Clear(String) |
Removes all log messages with the specified category.
| |
GetMessages |
Returns an all log messages in the logger.
| |
GetMessages(String) |
Returns all log messages with the specified category.
| |
RemoveMessage |
Removes a log message from the logger.
|
Name | Description | |
---|---|---|
LogMessageActivated | Obsolete. | |
LogMessageAdded |
Raised when a message is added.
| |
LogMessageRemoved |
Raised when a message is removed.
| |
MessageActivated |
Raised when a message is activated, e.g. double-clicked in the GUI.
|
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(); }