django-grpc icon indicating copy to clipboard operation
django-grpc copied to clipboard

Use Python logging module

Open dragonpaw opened this issue 3 years ago • 3 comments

In a couple places in the grpcserver command you have self.stdout.write which doesn't really play well with customized logging setups. Would it be possible for these to be logging.info() or logging.debug() calls instead?

dragonpaw avatar Oct 28 '21 19:10 dragonpaw

I used Django's approach that outputs everything into stdout or stderr https://github.com/django/django/blob/main/django/core/management/commands/runserver.py#L130

gluk-w avatar Nov 12 '21 15:11 gluk-w

Runserver isn't meant for production use though. For production Django you use the wsgi interface which doesn't log anything to stderr/stdout. So I figured this should be used in the same way as wsgi.

dragonpaw avatar Nov 12 '21 18:11 dragonpaw

That's true. Can you open pull request? I'm short of time right now

gluk-w avatar Nov 12 '21 19:11 gluk-w