Logria icon indicating copy to clipboard operation
Logria copied to clipboard

Sometimes `stdout` is slow to receive streams when `stderr` is fine

Open ReagentX opened this issue 3 years ago • 0 comments

Example to reproduce:

"""
Simple script to generate test logs
"""

import random
import time
import logging

def first():
    RANDINT = random.randint(1, 100)
    if RANDINT % 3 == 0:
        logging.warning('I am a first log! %s\x00', RANDINT)

def second():
    RANDINT = random.randint(1, 100)
    if RANDINT % 5 == 0:
        logging.error('I am a second log! %s\x00', RANDINT)
        
def third():
    RANDINT = random.randint(1, 100)
    if RANDINT % 7 == 0:
        logging.info('I am a third log! %s\x00', RANDINT)

logging.info('\x00I am the first log in the list! %s\x00', 0)
while True:
    first()
    second()
    third()
    RANDINT = random.randint(1, 100)
    print(f'I am standard output, {RANDINT}')
    time.sleep(0.001)

ReagentX avatar Dec 28 '22 01:12 ReagentX