Strawberry logs all exceptions as errors by default. Unfortunatelly that is both wrong, and generates a lot of noise. I would hereby like to propose to update the schema class to allow one to specify a custom logger.
Current implementation:
class StrawberryLogger:
logger
@classmethod
def error(cls, ...):
cls.logger.error(...)
...
class Schema:
...
def process_errors(self, errors, execution_context):
StrawberryLogger.error(error, execution_context)
...
Proposed change:
class StrawberryLogger:
logger
# note this is now an instance method
def error(self, ...):
self.logger.error(...)
...
class Schema:
def __init__(self, ..., logger):
self.logger = logger or StrawberryLogger()
def process_errors(self, errors, execution_context):
self.logger.error(error, execution_context)
...
This would allow one to extend the built-in StrawberryLogger
as they please/need. FWIW in my case, I'd override the error method to make it more discriminate.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too