-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple interactive loggers #44
Comments
Any update in this feature request? |
I'd really like to see this feature in next version |
As a workaround, you could add an empty |
any update? |
Any update on this? |
1 similar comment
Any update on this? |
As a workaround inspired from @tomkln comment, here is how I export my logger : import signale, { DefaultMethods, Signale, SignaleOptions } from 'signale'
export const getLogger = (
scope: string,
options: SignaleOptions = {},
): Signale<DefaultMethods> & { breakInteractiveChain: () => void } =>
Object.assign(new Signale({ scope, ...options }), {
// eslint-disable-next-line no-console
breakInteractiveChain: () => console.log(),
})
export default signale And here is how I consume it : const iLogger = getLogger('send-mail', { interactive: true })
iLogger.await('Fetching users')
iLogger.success('Users fetched')
// Prevent subsequent calls to interactive logger to override previous ones
iLogger.breakInteractiveChain()
iLogger.await('Sending mails')
iLogger.success('Mails sent') If this |
Is it possible to have multiple interactive loggers that update independently of each other (either separated by scope or
Signale
instance)? It seems that the current behavior is that the most recent call to an interactive logger will overwrite any previous interactive output.Here's an example of what I'm trying and the desired output:
Output:
Only displays the "scope 2"/
interactive2
logsDesired output:
The text was updated successfully, but these errors were encountered: