GithubHelp home page GithubHelp logo

Comments (10)

kentcdodds avatar kentcdodds commented on May 19, 2024

Hmmmmm. I think that'd be fine. But I seem to remember someone having an issue with us using anything but stderr for logging off that nature. Maybe @osener and @denis-sokolov could share their thoughts.

from prettier-eslint-cli.

denis-sokolov avatar denis-sokolov commented on May 19, 2024

Indeed we donโ€™t respect the log-level and we should.

I donโ€™t believe we respected it before 81f6542 either. We switched from console.log to console.error, we did not touch the logger that was added in #31.

@jackfranklin, for your needs you should do unix pipe redirection anyway: eslint-prettier-cli 2>/dev/null will hide diagnostic messages. Why bother with log level?

from prettier-eslint-cli.

jackfranklin avatar jackfranklin commented on May 19, 2024

@denis-sokolov that's fair, I didn't think of doing that. However I do think I should be able to achieve the same by setting log level to silent - to me that's more intuitive. I am happy to take a stab at the PR if you'd like, else feel free to go ahead and close :)

Thanks for all your work on this tool btw ๐ŸŽ‰

from prettier-eslint-cli.

kentcdodds avatar kentcdodds commented on May 19, 2024

Thanks @denis-sokolov! Yeah, let's get a PR merged that not only preserves the stderr behavior but also honors the log-level. Probably wont be able to use logger because it uses stdout for everything except error (also it prefixes all messages and this one we wouldn't want prefixed) which wouldn't make sense to me. I think most folks like to see it by default, so what do you think we log it unless the log level is set to silent?

from prettier-eslint-cli.

jackfranklin avatar jackfranklin commented on May 19, 2024

Agree - so shall I leave the calls using console.error but wrap them in an if (logLevel is silent) type thing?

from prettier-eslint-cli.

kentcdodds avatar kentcdodds commented on May 19, 2024

That sounds perfect ๐Ÿ‘

from prettier-eslint-cli.

jackfranklin avatar jackfranklin commented on May 19, 2024

PS: I still find it kinda weird that the success case still uses console.error but I'm willing to go with that ;)

PR coming at ya tonight or tomorrow ๐Ÿ‘

from prettier-eslint-cli.

denis-sokolov avatar denis-sokolov commented on May 19, 2024

@jackfranklin, if you find console.error weird, consider that itโ€™s just a shorthand. From inside the Node program we can directly write to any of the standard outputs with process.stdout.write and process.stderr.write.

from prettier-eslint-cli.

jackfranklin avatar jackfranklin commented on May 19, 2024

@denis-sokolov I meant more in that I find it odd that there's a success message, and you use console.error to log it. I can understand why but it's a bit jarring on first glance! I'll get a PR in soon based on Kent's suggestions - thanks for your help clarifying :)

from prettier-eslint-cli.

kentcdodds avatar kentcdodds commented on May 19, 2024

It is a bit jarring, maybe as part of your PR you could add a short comment explaining why.

from prettier-eslint-cli.

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.