Checkbox does not print messages sys.stdout.write

I am launching a flash app from this one with the command python app.py

.

No more logs printed using sys.stdout.write

are printed to the console. However, the use logging.StreamHandler

works for redirecting messages to stdout.

He works,

import logging
import logging.handlers
logger = logging.getLogger('kumologging')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
logger.addHandler(ch)
logger.info("hey, i am from logger obj")

      

Does not work

import sys
sys.stdout.write("hey, i am from stdout")

      

Checkbox overrides sys.stdout file descriptor redirecting logs elsewhere?

+3


source to share


1 answer


afaik flasks app.run()

uses webpackgunicorn

I believe the cannon assault is the one that actually redirects your exit



the output might be in /var/log/gunicorn/error.log

(not sure where it will be on windows: /)

or its possible sys.stdout

just doesn't flush its buffer, try sys.stdout.flush()

after typing it

+4


source







All Articles