Multiple interactive loggers
See original GitHub issueIs 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!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:19
- Comments:7
Top Results From Across the Web
Multiple interactive loggers #44 - klaudiosinani/signale - GitHub
Is it possible to have multiple interactive loggers that update independently of each other (either separated by scope or Signale instance)?
Read more >To Configure Multiple Periodic Stats Loggers | Ping Identity ...
Multiple Periodic Stats Loggers can be created to log different statistics, view historical information about gauges, or to create a log at different...
Read more >Python logging in interactive sessions - Stack Overflow
Yes, you are creating and reusing a single instance of your logger. Each handler added to that logger is also logging a message....
Read more >Logging providers - .NET - Microsoft Learn
For example, the Azure Application Insights provider stores logs in Azure Application Insights. Multiple providers can be enabled.
Read more >8 Advanced Python Logging Features that You Shouldn't Miss
Handler specifies the destination of log messages. A log message can be sent to more than one destination. The logging module actually provides ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As a workaround, you could add an empty
console.log();
after your last interactive log message. It starts a new line and prevents updates to the previous line.As a workaround inspired from @tomkln comment, here is how I export my logger :
And here is how I consume it :
If this
console.log()
hack finally is the preferred solution, I could make a tiny PR about this.