Giter Site home page Giter Site logo

Better reporting about check-pages HOT 3 CLOSED

davidanson avatar davidanson commented on May 28, 2024
Better reporting

from check-pages.

Comments (3)

DavidAnson avatar DavidAnson commented on May 28, 2024 1

Glad you like it!

To your first point, check-pages is a library, so logging and error handling are generally up to whatever code is using it. The API allows you to pass console as the Host parameter for easy logging (https://github.com/DavidAnson/check-pages/blob/master/README.md#host), but you can pass something else that customizes the output if you'd like (such as by coloring it or adding pretty icons). Regarding the exception you are getting, I think that check pages handles it's own errors properly, but if you have a simple demonstration of the problem, I'd like to understand if this is actually a bug in my code.

Regarding your second point, colorization and summarization of output is something that the check-pages-cli package (https://github.com/DavidAnson/check-pages-cli) already supports. If that's relevant to your scenario, please try it out because you may find it's easier to use and maybe more friendly. :)

from check-pages.

DavidAnson avatar DavidAnson commented on May 28, 2024

Assuming the above reply was helpful, I'm closing this issue to clean up. Thanks!

from check-pages.

lukasoppermann avatar lukasoppermann commented on May 28, 2024

Hey @DavidAnson, thank you for your answer. The cli is a little inconvenient as I am using it in gulp, however, I just use the logging function from there and it is perfect. For anybody who needs it:

  let host = {
    "log": function log (msg) {
      console.log(chalk.green('✔ ' +msg));
    },
    "error": function error (msg) {
      console.error(chalk.red('× ' +msg));
    }
  };

  checkPages(host, options, callback)

I believe the issues arise from redirects on my side, the page errors did not show up before I used your function. So I will investigate this further.

from check-pages.

Related Issues (9)

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.