Skip to content

Commit

Permalink
Disable django.db.backends.schema logging
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed Jan 4, 2025
1 parent fb287e6 commit b3a465e
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions app/app/settings/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,24 @@
}
}

class DisableMigrations(object):
def __contains__(self, _):
return True

def __getitem__(self, _):
return "notmigrations"

MIGRATION_MODULES = DisableMigrations()
LOGGING = {
'version': 1,
'handlers': {
'devnull': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': os.devnull,
},
},
'loggers': {
'django.db.backends.schema': {
'handlers': ['devnull'],
'propagate': True,
'level': 'INFO',
},
'': {
'handlers': ['file'],
'level': 'DEBUG',
}
}
}

0 comments on commit b3a465e

Please sign in to comment.