# StateMachineLogger

> Provides methods for logging messages, warnings, and errors associated with a state machine.

## Definition

* **Type:** Class
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.7/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
public class StateMachineLogger
```

## Remarks

`StateMachineLogger` integrates with the Unity Console to display logs relevant to state machine operations.

When a context is provided, the message is also visually represented in the state machine editor using appropriate markers (error, warning, or info).

Console messages are only shown if the state machine editor for the corresponding state machine is currently open. If the editor is closed, the logs will not appear in the Unity Console.

The logger also provides read-only access to what changed in the state machine via [StateMachineLogger.StateMachineChanges](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachinelogger/statemachinechanges.md).

## Properties

| Property                                                                                                                   | Description                                                                                                                                                                                                         |
| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [StateMachineChanges](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachinelogger/statemachinechanges.md) | The set of changes recorded on the state machine during the current [StateMachine.OnStateMachineChanged](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachine/onstatemachinechanged.md) callback. |

## Methods

| Method                                                                                                   | Description                    |
| -------------------------------------------------------------------------------------------------------- | ------------------------------ |
| [Log](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachinelogger/log.md)               | Logs an informational message. |
| [LogError](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachinelogger/logerror.md)     | Logs an error message.         |
| [LogWarning](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachinelogger/logwarning.md) | Logs a warning message.        |
