question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logging doesn't display the last log statement.

See original GitHub issue

when calling logger.<level>(‘message’); the last line you log doesn’t appear in the output.

import { Listr, Logger } from 'listr2';

new Listr({
  title: 'this task',
  task: () => {
    const logger = new Logger({ useIcons: true });

    logger.start('hello there!');
    logger.data('testing 123');
  },
})
  .run()
  .then(() => console.log('done'));

output

⠋ this task
❯ hello there!
✔ this task
done

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cenk1cenk2commented, Sep 6, 2021

Anyways in the example you have provided, it will just show it momentarily then collapse it off.

1reaction
cenk1cenk2commented, Sep 6, 2021

But it will always have the latest output, so the idea here is to not have proper logging but have something to show the user what the current status of that action is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python logging not outputting anything - Stack Overflow
I defined in a separate script a simple function that does both actions above (setting the logging level to info and the formatting...
Read more >
Logging HOWTO — Python 3.11.1 documentation
Displaying the date/time in messages​​ To display the date and time of an event, you would place '%(asctime)s' in your format string: import...
Read more >
Why Are Some Logging Messages Missing in Python? - jdhao
Missing log message. This works well when I show info messages. Later, I want to show some debug messages via my logger.
Read more >
How to Get Started with Logging in Python - Better Stack
In the example above, we've imported the logging module, and we're using two of its methods: info() and warning() . Copied!
Read more >
Python Logging: A Stroll Through the Source Code
When you log a message, an instance of the LogRecord class is the object you send to be logged. It's created for you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found