我如何查看每个文件中日志的输出

时间:2018-09-11 04:43:55

标签: django-rest-framework

from rest_framework import serializers
import logging

logger = logging.getLogger(name)


class MySerializer(serializers.ModelSerializer):
    def create(self, validated_data):
        logger.info('Information incoming!')
        return response

    def update(self, instance, validated_data):
        logger.error('Something went wrong!')

0 个答案:

没有答案