feat: add logging and support for custom logger (#36)

* feat: add support for logging

* fix linting

* chore: remove old APIError in favor of ServerError
This commit is contained in:
Mateusz Filipowicz
2025-02-23 12:59:46 +01:00
committed by GitHub
parent 95a4ff87ea
commit e79dcb13f0
13 changed files with 260 additions and 63 deletions

View File

@@ -71,6 +71,10 @@ if err != nil {
- `HttpTransportCustomizer` for transport-level customization
- `HttpRoundTripperProvider` for complete HTTP client control
4. **Removed unifi.APIError**:
- Old: `unifi.APIError` struct for API errors
- New: Standard `unifi.ServerError` struct for API errors
5. **Additional Features in filipowm/go-unifi**:
- Validation modes (Soft, Hard, Disabled)
- Request/Response interceptors
@@ -90,6 +94,7 @@ if err != nil {
})
```
4. Remove explicit `Login()` calls as they are now handled automatically, unless you use [bare client initialization](./getting_started.md#BareClientInitialization)
5. Replace usage of `unifi.APIError` with `unifi.ServerError`
The rest of your code using the client methods should continue to work as before, as the API methods remain the same.