Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Accept subscriptions #4

Open
Open
@JesusTheHun

Description

This lib is great for other libs because it is minimal, there is nothing to learn.

I maintain a few packages, some with IO, like database IO.
I use @open-draft/logger and I would like the consumer of my lib to be able to receive its logs, like database query.
But you don't want to handle every logging logic, there are great libs out there for that.

If one could just subscribe(fn), it would allow consumers to plugin in their own solution, without us, maintainers having to manage anything.

// lib.ts
const logger = new Logger('someLib');
export const onSomeLibLog = logger.subscribe;
// app.ts
import { onSomeLibLog } from 'someLib';
onSomeLibLog(log => {
 appLogSolution.write(log);
})

I'm willing to submit a PR for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /