Git Product home page Git Product logo

Comments (6)

damccorm avatar damccorm commented on June 11, 2024 3

Hm, I think as I consider this more I'm actually convinced that we should have this. Thanks for the feedback.

Ultimately, while the other logging functions do have special implementations on the runner, we're exposing a logging interface and the author shouldn't have to understand that distinction. Addressed in #111

from toolkit.

damccorm avatar damccorm commented on June 11, 2024

I think you can do this with a simple console.log statement, is there a use case where something else is necessary?

from toolkit.

josephperrott avatar josephperrott commented on June 11, 2024

I believe this is the case, but it seems odd that you would use debug(), error() and warning() from @actions/core and then just use a built-in console.log otherwise. I would expect that all of the logging should occurring using methods from the same object.

from toolkit.

damccorm avatar damccorm commented on June 11, 2024

I think the difference is that our runner has built in commands for debug/error/warning so that it processes them differently (e.g. color coding), while there's no command for info (and it doesn't really make sense for there to be one). I think I'd personally be more confused by why a function like that would exist/would assume it was hooked up to a special runner command as well.

from toolkit.

josephperrott avatar josephperrott commented on June 11, 2024

Okay, I am happy to use console.log.

As a data point in terms of discoverability/intiutation (and its obviously just a single data point), I expected the info() method to exist as there is a section for Logging Commands, so I figured that would be how all of my logging should be done.

// Logging Commands

from toolkit.

xt0rted avatar xt0rted commented on June 11, 2024

I was confused by this at first too. Once I realized what the core.debug() etc. functions did it made sense why there wasn't one for info. It could be useful to mention this in the docs.

I've been considering creating my own logger that uses the methods from this package when available, and then fall back to console for the rest. That way I have a consistent logging experience.

Another option was to use console everywhere and then replace console.debug etc. with the copies from this package. This would also work better with other packages that use the console functions.

from toolkit.

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.