Skip to content

Commit 9e89933

Browse files
committed
Debug and Handlers documentation updates
1 parent 1941353 commit 9e89933

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

Documentation/docs/events/Examples.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ The following serves as a few examples on how to utilize the built in event syst
77

88
## Pattern
99

10-
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:
10+
All events are available on the client instance: `client.<event_name>`.
11+
12+
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).
1113

1214
```csharp
1315
client.AfterDisconnect += MyAfterDisconnectHAndler
1416
```
1517

16-
...where `MyAfterDisconnectHandler` is an already-defined function in my application.
18+
...where `MyAfterDisconnectHandler` is an already-defined function in my application with the following signature:
19+
20+
```csharp
21+
static void MyAfterDisconnectHandler(object? sender, AfterDisconnectEventArgs eventArgs)
22+
```
1723

1824
### Lambdas
1925

@@ -26,6 +32,10 @@ client.AfterUnsubscribe += (sender, args) =>
2632
}
2733
```
2834

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

3141
This example simply prints out the `HiveMQClientOptions` prior to the connect command being sent to the broker.

Documentation/docs/how-to/debug.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# How to Debug
2+
3+
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.
4+
5+
# Understanding TRACE Level Logging
6+
7+
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.
8+
9+
See [How to Configure Logging](/docs/how-to/configure-logging) for the specifics on how to enable TRACE logging.

0 commit comments

Comments
 (0)