Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Print statement from example does not show up in logs for me but logging lib works #300

Open
janvdvegt opened this issue Jan 26, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@janvdvegt
Copy link

Long story short

Print statements do not show up in logs in bare bones example. Replacing them with logging.info works.

Description

Example code from docs:

import kopf

 @kopf.on.create('zalando.org', 'v1', 'ephemeralvolumeclaims')
 def create_fn(body, **kwargs):
     print(f"A handler is called with body: {body}")

This does work:

import kopf
import logging

 @kopf.on.create('zalando.org', 'v1', 'ephemeralvolumeclaims')
 def create_fn(body, **kwargs):
     logging.info(f"A handler is called with body: {body}")

I tried to set PYTHONUNBUFFERED to 0 but this did not matter.

Environment

  • Kopf version: 0.24
  • Kubernetes version: 0.12.4
  • Python version: 3.7
  • OS/platform: MacOS

By using the logging library it does not block me in whatever way but the base example does not work for me so I just wanted to notify you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant