Multiple interactive loggers
Author: br0p0pCreated Jun 15, 2018Updated Jun 13, 2021
Labelsfeature request
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:
const { Signale } = require('signale');
const interactive = new Signale({ interactive: true, scope: 'scope 1' });
setTimeout(() => {
interactive.success('[%d/4] - Process A', 2);
setTimeout(() => {
interactive.await('[%d/4] - Process B', 3);
setTimeout(() => {
interactive.error('[%d/4] - Process B', 4);
setTimeout(() => {}, 2000);
}, 4000);
}, 3000);
}, 2000);
const interactive2 = new Signale({ interactive: true, scope: 'scope 2' });
setTimeout(() => {
interactive2.info('[%d/3] - starting it...', 1);
setTimeout(() => {
interactive2.await('[%d/3] - doing it...', 2);
setTimeout(() => {
interactive2.success('[%d/3] - finished it!', 3);
setTimeout(() => {}, 2000);
}, 4000);
}, 3000);
}, 2000);Output:
Only displays the "scope 2"/interactive2 logs
[scope 2] › ✔ success [3/3] - finished it!Desired output:
[scope 1] › ✖ error [4/4] - Process B
[scope 2] › ✔ success [3/3] - finished it!Source: klaudiosinani/signale