Coder Social home page Coder Social logo

print fewer warnings about quip HOT 15 CLOSED

bernstei avatar bernstei commented on August 20, 2024 1
print fewer warnings

from quip.

Comments (15)

gabor1 avatar gabor1 commented on August 20, 2024

It's not really a warning, it's telling you what it's doing

from quip.

bernstei avatar bernstei commented on August 20, 2024

I know what it's doing - I gave it the (lack of) arguments. This message just litters my stdout (or stderr). I'd at least like a quiet mode.

from quip.

Sideboard avatar Sideboard commented on August 20, 2024

How about this:

  • Change "WARNING" to "INFO" (or no prefix).
  • Change verbosity from normal to verbose (or even nerd).

from quip.

jameskermode avatar jameskermode commented on August 20, 2024

I'd be happy with those changes

from quip.

bernstei avatar bernstei commented on August 20, 2024

OK. Shall I do a PR?

from quip.

jameskermode avatar jameskermode commented on August 20, 2024

Please go ahead if you have time

from quip.

bernstei avatar bernstei commented on August 20, 2024

I'm going to code it up with a separate message_type string argument which will be "INFO" here (and default to "WARNING" for backward compatibility), and independent verbosity, although one could imagine having the verbosity derived from the message type. I don't think it's worth it to recreate the complexity of python's logging/warning interface here. If someone else feels strongly about it, feel free to modify my PR or even just let me know.

I would perhaps consider replacing print_warning with print_message, because that can be updated with a search and replace: print_warning(message) -> print_message('WARNING', message)

from quip.

Sideboard avatar Sideboard commented on August 20, 2024

I would prefer for it to not be named print_warning when it may not be a warning at all. Also, print_warning is anyway only a wrapper to not add the prefix explicitly. Is it worth it to have print_message, which then calls print, or could it be print everywhere?

from quip.

jameskermode avatar jameskermode commented on August 20, 2024

Noam’s solution in the PR plus the offer of search and replace for print_message() sounds a good compromise to me.

from quip.

bernstei avatar bernstei commented on August 20, 2024

I definitely don't want just print, because if nothing else it'll be harder to do with a search and replace (adding a new initial argument is much easier with a regexp), but I'll do print_message().

from quip.

bernstei avatar bernstei commented on August 20, 2024

Or does that violate the "libatoms is dead, minimal changes only" principle, and I should just revert print_warning and add print_info() function? It's certainly less likely to lead to missed changes.

from quip.

Sideboard avatar Sideboard commented on August 20, 2024

I wasn't aware of that principle. 😅

Both print_message and print_info are possible solutions. I don't think it's likely that you miss a print_warning.

Then again, print_warning is such a simple procedure (a single string argument) that replacing it with print should not be that difficult. Although, I had single lines in mind, with multiple lines it would get ugly. Just checked: 11 out of 67 calls are multilined.

Edit: Oh wait, replacing with print("WARNING: " // should be simpler than replacing with print_message( plus additional arguments for multilined ones. 🤔

from quip.

jameskermode avatar jameskermode commented on August 20, 2024

I think print_warning() -> print_message() is a perfectly good solution. If you do the search/replace I'll approve and merge.

from quip.

bernstei avatar bernstei commented on August 20, 2024

Take a look at the latest commit.

from quip.

jameskermode avatar jameskermode commented on August 20, 2024

New release v0.9.11 including this PR is now on PyPI, so let the warnings be silenced!

from quip.

Related Issues (20)

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.