-
Notifications
You must be signed in to change notification settings - Fork 0
Open
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
Labels
No labels