Python Forum
logging messages ahead of print messages
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
logging messages ahead of print messages
#5
I think it depends on the terminal you use. I use xonsh and have sometimes problems with my terminal.
Also ncurses seems not to work with my configuration. In this case I have use /bin/bash.
You have also to recognize, that you have 3 streams: Standard input/output/error

Exceptions and logging is always on stderr. Output of data is stdout.
The print function outputs the text by default on stdout, but you can change it.

If you repeat the test, where the order was wrong, add following to your print function:
print('message', file=sys.stderr)
Tell us, what happens.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
logging messages ahead of print messages - by vindo - Jun-13-2019, 05:24 PM
RE: logging messages ahead of print messages - by DeaD_EyE - Jun-14-2019, 02:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Script that alternates between 2 text messages DiscoMatic 1 580 Dec-12-2023, 03:02 PM
Last Post: buran
  Can I use logging in a class (without multiple messages) mevan 2 687 Oct-16-2023, 11:08 PM
Last Post: mevan
  How to continuously receive messages until specified to stop using Bleak jacobbreen25 3 2,317 Dec-28-2022, 04:25 PM
Last Post: jacobbreen25
Question Help with function - encryption - messages - NameError: name 'message' is not defined MrKnd94 4 3,090 Nov-11-2022, 09:03 PM
Last Post: deanhystad
  Reordering output messages paulo79 4 1,671 May-25-2022, 04:46 PM
Last Post: menator01
  pySerial - missed messages q_nerk 2 1,823 Jan-27-2022, 09:59 PM
Last Post: Jeff_t
  logging vs print syafiq14 2 1,991 Aug-28-2021, 10:23 AM
Last Post: snippsat
  Logstash - sending Logstash messages to another host in case of Failover in python Suriya 0 1,720 Jul-27-2021, 02:02 PM
Last Post: Suriya
Question Yielding ahead of time Daring_T 5 2,553 Jun-01-2021, 02:43 AM
Last Post: Daring_T
  User serial/pyserial to send messages to an arudino via terminal manually bkapadia 2 2,828 Mar-10-2021, 11:26 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020