Skip to content

Commit

Permalink
Debug and Handlers documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pglombardo committed Dec 27, 2023
1 parent 1941353 commit 9e89933
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Documentation/docs/events/Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ The following serves as a few examples on how to utilize the built in event syst

## Pattern

All events are available on the client instance: `client.<event_name>`. Handlers can be assigned to the event by simply adding your handler to the list:
All events are available on the client instance: `client.<event_name>`.

Handlers can be assigned to the event by simply adding your handler to the list. Handlers can be either a pre-defined function or a lambda (illustrated in the next section).

```csharp
client.AfterDisconnect += MyAfterDisconnectHAndler
```

...where `MyAfterDisconnectHandler` is an already-defined function in my application.
...where `MyAfterDisconnectHandler` is an already-defined function in my application with the following signature:

```csharp
static void MyAfterDisconnectHandler(object? sender, AfterDisconnectEventArgs eventArgs)
```

### Lambdas

Expand All @@ -26,6 +32,10 @@ client.AfterUnsubscribe += (sender, args) =>
}
```

### Event Arguments

The definitions for all event arguments [can be found here](https://github.com/hivemq/hivemq-mqtt-client-dotnet/tree/main/Source/HiveMQtt/Client/Events).
## Display Options Prior to Connecting

This example simply prints out the `HiveMQClientOptions` prior to the connect command being sent to the broker.
Expand Down
9 changes: 9 additions & 0 deletions Documentation/docs/how-to/debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# How to Debug

When working with the HiveMQtt client, there may be instances where deeper insight into the internal workings of the client is necessary to troubleshoot or understand its behavior. One of the most effective ways to gain this insight is through TRACE level logging.

# Understanding TRACE Level Logging

TRACE level logging is the most detailed form of logging, providing comprehensive information about the events happening within the HiveMQtt client. Enabling TRACE logging allows you to see a fine-grained view of the client's operations, which can be invaluable for debugging complex issues.

See [How to Configure Logging](/docs/how-to/configure-logging) for the specifics on how to enable TRACE logging.

0 comments on commit 9e89933

Please sign in to comment.