Missing logger

Đang mở
#429 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu bằng cách lần theo các điểm vào của tìm kiếm và request trong Python client, sau đó so sánh chúng với hành vi của DebugLogger trong PHP client được mô tả ở đây. Xác định cách inject một logger cụ thể và cách các implementation tùy chỉnh nhận các request event; bổ sung test coverage cho việc bật debug logging và cung cấp một production logger.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
207
Fork
63
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của algolia/algoliasearch-client-python

Tất cả issue của algolia/algoliasearch-client-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.