[Bug]: obsolete custom message logging
- 主要言語
- Python
- スター
- 73
- フォーク
- 11
- 平均マージ
- 8時間 51分
- マージ済み PR(30日)
- 4
説明
## Overview
When working with frameworks that rely both on `FEDOT` and `GOLEM`, one can encountered a problem when trying to log using the `message` method. The problem is that the incorrect logging level is set, which results in an error of `KeyError: 45`.
This issue has already been discussed. The no-brainer solution to this unexpected behavior is to replace the `level` value with one of the default levels (for example, `40`). Additionally, it might be appropriate to display a message that the `message` method is now outdated and doesn't differ from the `info` method.
https://github.com/aimclub/GOLEM/blob/c85a9d79ae47bcaa116c6c2a845a553b50dfaedb/golem/core/log.py#L165-L170
A listing of a rather ugly workaround mock in our test suite
```py
def mock_message(self, msg: str, **kwargs):
level = 40
self.log(level, msg, **kwargs)
@pytest.mark.parametrize('pipeline_case', LINEAR_PIPELINE_CASES, ids=str)
def test_valid_linear_pipelines(pipeline_case: LinearPipelineCase, monkeypatch):
# monkeypatch golem message function
monkeypatch.setattr(golem.core.log.LoggerAdapter, 'message', mock_message)
...
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。