google / google/python-fire

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

Open
#140 1 comment 10 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
28.2k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

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)`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.