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
#7
(Jun-14-2019, 02:40 PM)DeaD_EyE Wrote: 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.

The results are as expected.
Can you please elaborate?

Does error messages(stderr) get more priority over the normal output messages (stdout) ?
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 vindo - Jun-18-2019, 02:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Script that alternates between 2 text messages DiscoMatic 1 546 Dec-12-2023, 03:02 PM
Last Post: buran
  Can I use logging in a class (without multiple messages) mevan 2 617 Oct-16-2023, 11:08 PM
Last Post: mevan
  How to continuously receive messages until specified to stop using Bleak jacobbreen25 3 2,192 Dec-28-2022, 04:25 PM
Last Post: jacobbreen25
Question Help with function - encryption - messages - NameError: name 'message' is not defined MrKnd94 4 2,944 Nov-11-2022, 09:03 PM
Last Post: deanhystad
  Reordering output messages paulo79 4 1,614 May-25-2022, 04:46 PM
Last Post: menator01
  pySerial - missed messages q_nerk 2 1,784 Jan-27-2022, 09:59 PM
Last Post: Jeff_t
  logging vs print syafiq14 2 1,945 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,694 Jul-27-2021, 02:02 PM
Last Post: Suriya
Question Yielding ahead of time Daring_T 5 2,465 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,764 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