Missing logger

オープン
#429 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

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

調査の方向性

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

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

説明

Discussion Good First Issue
  • 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:

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
スター
207
フォーク
63
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

algolia/algoliasearch-client-python のほかの issue

algolia/algoliasearch-client-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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