Skip to content

Commit be9b131

Browse files
authored
Development: argument to set logging level (#167)
It was a little annoying that we had the logging level set to DEBUG since we are flooded wth a lot of messages, even when debugging things. I set the default logging level to INFO, but added a `log-level=` argument to easily change it in case we want to be more verbose while working locally.
1 parent 858880e commit be9b131

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

dockerfiles/docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ services:
4343
environment:
4444
- DOCKER_NO_RELOAD
4545
- RTD_PRODUCTION_DOMAIN
46+
- RTD_LOGGING_LEVEL
4647

4748
# Allow us to run `docker attach readthedocsorg_proxito_1` and get
4849
# control on STDIN and be able to debug our code with interactive pdb
@@ -77,6 +78,7 @@ services:
7778
- RTD_PRODUCTION_DOMAIN
7879
- MINIO_ROOT_USER=admin
7980
- MINIO_ROOT_PASSWORD=password
81+
- RTD_LOGGING_LEVEL
8082
stdin_open: true
8183
tty: true
8284
networks:
@@ -104,6 +106,7 @@ services:
104106
- DOCKER_NO_RELOAD
105107
- CELERY_LOG_LEVEL=${CELERY_LOG_LEVEL:-INFO}
106108
- RTD_PRODUCTION_DOMAIN
109+
- RTD_LOGGING_LEVEL
107110
stdin_open: true
108111
tty: true
109112
networks:
@@ -123,6 +126,7 @@ services:
123126
- DOCKER_NO_RELOAD
124127
- CELERY_LOG_LEVEL=${CELERY_LOG_LEVEL:-INFO}
125128
- RTD_PRODUCTION_DOMAIN
129+
- RTD_LOGGING_LEVEL
126130
stdin_open: true
127131
tty: true
128132
networks:
@@ -157,6 +161,7 @@ services:
157161
- DOCKER_NO_RELOAD
158162
- CELERY_LOG_LEVEL=${CELERY_LOG_LEVEL:-INFO}
159163
- RTD_PRODUCTION_DOMAIN
164+
- RTD_LOGGING_LEVEL
160165
stdin_open: true
161166
tty: true
162167
networks:

dockerfiles/tasks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ def down(c, volumes=False):
4343
'ext-theme': 'Enable new theme from ext-theme (default: False)',
4444
'scale-build': 'Add additional build instances (default: 1)',
4545
'ngrok': 'ngrok domain to serve the application. Example: "17b5-139-47-118-243.ngrok.io"',
46+
'log-level': 'Logging level for the Django application (default: INFO)',
4647
})
47-
def up(c, search=True, init=False, reload=True, webpack=False, ext_theme=False, scale_build=1, ngrok=""):
48+
def up(c, search=True, init=False, reload=True, webpack=False, ext_theme=False, scale_build=1, ngrok="", log_level='INFO'):
4849
"""Start all the docker containers for a Read the Docs instance"""
4950
cmd = []
5051

5152
cmd.append('INIT=t' if init else 'INIT=')
5253
cmd.append('DOCKER_NO_RELOAD=t' if not reload else 'DOCKER_NO_RELOAD=')
54+
cmd.append(f'RTD_LOGGING_LEVEL={log_level}')
5355

5456
cmd.append('docker-compose')
5557
cmd.append('--project-directory=.')

0 commit comments

Comments
 (0)