py-pdf/pypdf

DOC: How to handle / customize log records emitted by pypdf

開放

#2,020 建立於 2023年7月26日

 (8 則留言) (0 個反應) (0 位負責人)Python (1,258 個分叉)batch import
Easyhelp wantednf-documentation

倉庫指標

星標
 (6,413 顆星)
PR 合併指標
 (平均合併 8天) (30 天內合併 49 個 PR)

描述

Explanation

According to https://github.com/py-pdf/pypdf/blob/11ee6480a3f795d770da89944f32a977e3c110e2/pypdf/_utils.py#L433-L449

logger_warning is advertised to allow overwriting, but doing so proves to be more complicated than expected.

There basically are two reasons for this:

  1. The implementation is located at pypdf._utils.logger_warning, which usually marks an internal implementation and thus I would not assume this to be future-proof.
  2. The method usually is imported directly, as can be seen in https://github.com/py-pdf/pypdf/blob/11ee6480a3f795d770da89944f32a977e3c110e2/pypdf/filters.py#L46 for example. This requires patching each import separately.

貢獻者指南