I’ve noticed that django.contrib.auth
’s management.create_permissions
is too noisy on stdout without allowing any way to suppress it at runtime.
Loading environment 'development'
...
Running migrations:
Applying contenttypes.0001_initial... OK
Applying app.0001_initial... OK
...
Applying app.0002_enable_user_permissions... OK
Adding content type 'app | user'
Adding content type 'app | foo'
Adding content type 'app | bar'
...
Adding permission 'app | user | Can add user'
Adding permission 'app | user | Can change user'
... // More logs of the same format.
I’m not sure if this is the intended behaviour (and please correct me if it is), but I’d imagine emitting to a logging.Logger
instead would allow them to be suppressed with a custom logging configuration such as the following:
logging.config.dictConfig({
...,
'loggers': {
...,
'django.contrib.auth': {
'level': 'ERROR',
'handlers': ['console']
}
}
})
I was advised to bring this up here and garner any feedback/concerns about landing django#16782.