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

Ideas for further checks #24

Open
kornicameister opened this issue Jul 6, 2020 · 6 comments
Open

Ideas for further checks #24

kornicameister opened this issue Jul 6, 2020 · 6 comments
Assignees

Comments

@kornicameister
Copy link
Owner

Here's a list of runtime thingies that caught us when working with loguru ;-).
Thanks to @Delgan support we know two of those being #18 and #7 . I bet there is more. This collective issue aims to bring this to our attention and have them implemented.

ToDo:

  • [ ]
@kornicameister kornicameister self-assigned this Jul 6, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.82. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@kornicameister
Copy link
Owner Author

kornicameister commented Jul 6, 2020

@Delgan if you have something more feel free to let me know :). If there are some users already, let us know too :)

@Delgan
Copy link
Collaborator

Delgan commented Jul 7, 2020

There are different possible errors "at runtime", I guess we can figure out some of them by looking at the raise statements in the loguru sources.

Here are some examples of code causing exceptions but not detected by mypy / type-hints:

  • logger.add(sys.stderr, level=-10) (negative level not allowed)
  • logger.level("FOOBAR", no=-10) (negative level not allowed)
  • logger.log(-10, "Message") (negative level not allowed)
  • logger.level("INFO", no=111) (updating the no of an existing level is not allowed)
  • logger.add("file.txt", foobar="xyz") (the open() builtin does not have a foobar argument)

There is also a whole range of "parsing" issues that I didn't listed (like parsing of color tags or rotation/retention).

@kornicameister
Copy link
Owner Author

Hmm...I think we can take some od those for later. @Delgan if you want to dive into wonderful world od mypy feel free to implement either of those 😁

@Delgan
Copy link
Collaborator

Delgan commented Jul 7, 2020

Honestly, I don't think it's worth spending time implementing this. I was just throwing some ideas. 😁

@kornicameister
Copy link
Owner Author

well perhaps having levels defined as int is enough. This is how typeshed does that. Maybe colors could be done like so if for example you requre hex like color codes, we could check against that. But that might low on prio for us.
I will keep this one here. If we people start using this plugin, they will be the best judge we can get ;)

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

No branches or pull requests

2 participants