google / google/python-fire

Feature Request: Add logging level support as a default parameter for functions

未关闭
#140 1 条评论 10 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Python
星标
28.2k
派生
1.5k
PR 合并指标
30 天内没有已合并 PR

描述

It would be nice to add a logging level option as a default option for all methods.

An ideal implementation would be like a decorator for a function: when a function is decorated, then the function will be added with `[--log-level INFO]` without specifying so.

For example, a method with a decorator:
```puthon
@fire.logger(logger_object):
def a_method(params1):
logger_object.debug('log line')
```

Will actually make `a_method(param1)` works like `a_method(param1, log_level=logging.INFO)`.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。