algolia / algolia/algoliasearch-client-python

Missing logger

オープン
#429 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
Discussion Good First Issue
主要言語
Python
スター
207
フォーク
63
PR マージ指標
30日以内にマージされた PR はありません

説明

- 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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず Python クライアントの検索およびリクエストのエントリポイントを追跡し、ここで説明されている PHP クライアントの DebugLogger の動作と比較します。具体的なロガーをどのように注入するか、カスタム実装がリクエストイベントをどのように受け取るかを定義し、デバッグロギングの有効化と本番用ロガーの提供を対象とするテストカバレッジを追加します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。