Git Product home page Git Product logo

Comments (7)

plata avatar plata commented on July 25, 2024

I would suggest to implement this as a Bean.

from scripts.

madoar avatar madoar commented on July 25, 2024

Can you give a short example how you would use this then from JS?

from scripts.

plata avatar plata commented on July 25, 2024

Basically no difference to what you suggested. The only point about it is that it would be implemented in Java such that it can be used from all script repositories.

from scripts.

madoar avatar madoar commented on July 25, 2024

The problem with a Java only solution (i.e. bean) is that we can't use destructuring. This means we would need to use something like:

const Logger = Bean(...);
const log = Logger.create("Zelda");

...
// later on
log.info("Start task x");
...

from scripts.

plata avatar plata commented on July 25, 2024

I do not see a problem with this syntax. Actually, I prefer logger.info and logger.debug over just info and debug because it makes clear that both belongs to logging.

from scripts.

madoar avatar madoar commented on July 25, 2024

I'm fine either way.

@qparis, @ImperatorS79, @Zemogiter do you have any preferences?

from scripts.

Zemogiter avatar Zemogiter commented on July 25, 2024

I prefer the first approach for the same reasons as stated in the OP.

from scripts.

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.