Giter Club home page Giter Club logo

Comments (3)

maraisr avatar maraisr commented on August 31, 2024

Hey 👋🏻 thank you so much for the issue (and fulfilling a PR) 💯

You raise a few good points,

print all messages from all loggers above a certain loglevel

Yeah the way I use it is almost exactly how you're describing in your PR, with the compare method in the onEmit. Should actually document that one 😅. And ya probably not the best DX to introduce that, especially if youre just wanting the default reporter.

The inheritance is a great idea! Not quite how I had envisioned it, my idea was consumers create their own createLogger function:

const onEmit = () => { ... };

export const createLogger = (name) => diarty(name, onEmit);

that way you can share the onEmit no problems — seeing as we're JavaScript, we typically scope loggers to a package. But ya if we want that rust vibe, abc:123:xyz (like I originally wanted), then yeah we need something to "extend/share".

So with that, thank you so much for the PR — will comment over there as well, you did docs, tests and code. Might amend it a little, just think if the : is a good separator we can enforce. Or if .diary is better/worse than .chapter — you know, "dear diary, today I x. Chapter 2, then I y", this a story telling logger.

Is any of this a blocker for you right now? Might leave it with my brain for a day. Also keen to get more of an insight to how youre using it, keen to jump on a call?

from diary.

abeforgit avatar abeforgit commented on August 31, 2024

yeah I totally missed that trick to just make a custom createLogger :D I think that basically covers my entire usecase now that I think about it, the inherited diary names is not something I really need. Would be a good idea to add that example to the docs in any case since I expect this usecase to come up quite a lot

As for the scope inheritance, I do quite like idea of it. Not sure how useful it will be in practice (going too heavy on the inheritance might actually hurt useability, and might discourage topic-based diaries) but it's a style that other loggers (e.g. loglevel ) seem to do as well so it feels quite natural.

Not sure about the diary.chapter syntax. It reads nicely, but how do you continue? diary.chapter.paragraph? and after that you kind of run out of words. It could be a conscious design decision to limit the amount of inheritance, but at that point I think I'd prefer no inheritance at all to avoid confusion.

None of this is really blocking for me, especially now that I see how I can share the onEmit without it.

I am available for a call if you'd like. My timezone is GMT+1 and I tend to be mentally available between 9:00 and 23:00
but practical considerations get in the way of course. This week especially is chaotic, wednesday or thursday will probably work out though.

from diary.

maraisr avatar maraisr commented on August 31, 2024

Hi @abeforgit thank you for your 3 year patience here with this. Going to close this issue as not planned 💕 thank you for being a loyal user all these years!

from diary.

Related Issues (14)

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.