Git Product home page Git Product logo

Comments (4)

issue-label-bot avatar issue-label-bot commented on May 29, 2024 1

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.

ThibaultLemaire avatar ThibaultLemaire commented on May 29, 2024

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.

kornicameister avatar kornicameister commented on May 29, 2024

@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.

ThibaultLemaire avatar ThibaultLemaire commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.