algolia / algolia/algoliasearch-client-python
Missing logger
- Langage dominant
- Python
- Étoiles
- 207
- Forks
- 63
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
- Algolia Client Version: latest
### Description
On the Algolia PHP Client, there is the logger feature that allow us to log what happens when a `search`|or other method is called. By default, there is a debug logger that will `print` the requests that are made by the client:
```php
Algolia\AlgoliaSearch\Logger\DebugLogger::enable();
$index->search('foo'); // Dumps information about the request on the console.
Algolia\AlgoliaSearch\Logger\DebugLogger::disable();
```
Example output on the console:
```
array:3 [
"level" => "debug"
"message" => "Algolia API client: Sending request."
"context" => array:6 [
"body" => array:1 [
"query" => "fo"
]
"headers" => array:4 [
"X-Algolia-Application-Id" => ".."
"X-Algolia-API-Key" => ".."
"User-Agent" => "Algolia for PHP (2.2.6); PHP (7.3.5)"
"Content-Type" => "application/json"
]
"method" => "POST"
"query" => []
"retryNumber" => 1
"host" => "https://..-dsn.algolia.net/1/indexes/contacts/query"
]
]
array:3 [
"level" => "debug"
"message" => "Algolia API client: Host failed."
"context" => array:7 [
"body" => array:1 [
"query" => "fo"
]
"headers" => array:4 [
"X-Algolia-Application-Id" => ".."
"X-Algolia-API-Key" => ".."
"User-Agent" => "Algolia for PHP (2.2.6); PHP (7.3.5)"
"Content-Type" => "application/json"
]
"method" => "POST"
"query" => []
"retryNumber" => 1
"host" => "https://..-dsn.algolia.net/1/indexes/contacts/query"
"description" => "An internal server error occurred on ..-dsn.algolia.net"
]
]
```
This issue addresses that feature, as we don't have a logger on the python client. The idea, would be inject a concrete implementation of the logger on the client, allowing people to use this logger for debug purposes, but also, eventually for production reasons using their own specific logger.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par retracer les points d’entrée de recherche et de requête du client Python, puis comparez-les au comportement de DebugLogger du client PHP décrit ici. Définissez comment un logger concret est injecté et comment les implémentations personnalisées reçoivent les événements de requête ; ajoutez une couverture de tests pour l’activation de la journalisation de débogage et la fourniture d’un logger de production.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- api
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100