Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log_first_n implementation doesn't match doc, ignores formatting args #142

Open
glados-verma opened this issue May 16, 2020 · 1 comment

Comments

@glados-verma
Copy link

The log_first_n doc says:

Logs 'msg % args' at level 'level' only first 'n' times

However, the implementation only tracks the caller's file and line number, and ignores the formatting args. So if I do something like:

for arg in ['arg1', 'arg2']:
  log_first_n('%s', 1, arg)

It will never log for arg2.

@yilei
Copy link
Contributor

yilei commented May 18, 2020

I can see how the docs can be interpreted as such. The implementation is the intention here, it only logs N times regardless what the message is.

Keeping this open so we'll remember to clarify it. Or feel free to send a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants