Comments (4)
Issue-Label Bot is automatically applying the label feature_request
to this issue, with a confidence of 0.87. Please mark this comment with 👍 or 👎 to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
from loguru-mypy.
I believe this would also allow fixing cases such as this (excerpt from #42 (comment)):
from loguru import logger
logger.configure(
handlers=[
dict(
sink=sys.stderr,
format="Site {extra[site]} broadcasting: {message}",
backtrace=False,
diagnose=False,
),
],
extra={"site": "unknown"},
)
site = 19
scp = 682
# We're passing the `site` number for local formatting of this message,
# but we're also passing the `scp` number as `extra` for the formatter of the handler.
logger.warning("SCP-{} containment breach detected", scp, site=site)
# error: Not all arguments converted during string formatting
from loguru-mypy.
@ThibaultLemaire If you have an idea how to implement, please do. I am now stucked on various interviews ;).
I see it gets more and more interesting now. We could easily do this similary to lazy=True|False
but this will work against your other idea.
If you don't mind, let's rollback to #43 . I can't exactly figure out how an idea from there should work. Do you plan on implementing something inside of loguru
or in this plugin? Sorry if that's silly question but it was long ago and I just want to refresh my memory.
from loguru-mypy.
If you have an idea how to implement, please do.
Honestly, I'm not sure I do. I just realised while working on #43 that we were returning a Type and that we were free to embed whatever we wanted on that type, so I figured this was the way mypy intended us to keep track of these kind of things (since storing global state is bad apparently). I'd like to dive into that, but I'm sure this is going to be some work, and I don't have the time right-now.
Do you plan on implementing something inside of loguru or in this plugin?
If I'm correct in what I wrote above, I should have all I need in this plugin. I hope I won't have to touch to loguru's source code, but I might consider it if there's no other way, now that mention it.
from loguru-mypy.
Related Issues (18)
- Combine coverage and upload to external service. HOT 1
- Document project HOT 2
- Figure out possibility of tracking logger objects HOT 1
- Add catching of `record=True` HOT 4
- Draft first release HOT 2
- Ideas for further checks HOT 6
- Add this to awesome-python-typing HOT 2
- Support attribute references of positional/keyword arguments with string formatting HOT 14
- Test against 3 latest releases of mypy + hard pin in plugin hook na latest HOT 2
- "Internal error" while logging non-string messages HOT 4
- Using `mypy` to verify `check_str_format_call`? HOT 2
- Implement handling of `OpExpr`
- Implement handling of `CallExpr`
- False positive on `extra` kwargs HOT 3
- Releases are not working HOT 1
- Cannot import loguru.Writable HOT 6
- Support new mypy 1.0 version specifiers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loguru-mypy.