ruslanmv commited on
Commit
4958271
1 Parent(s): 906a54b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -10,13 +10,22 @@ from io import BytesIO
10
  import random
11
  import logging
12
 
13
-
 
 
 
 
 
 
 
14
  # Configure the logging level
15
  logging.getLogger('eventlet.wsgi.server').setLevel(logging.ERROR)
16
 
17
 
18
 
19
  app = Flask(__name__)
 
 
20
  app.config['SECRET_KEY'] = 'your_secret_key'
21
  socketio = SocketIO(app, async_mode='eventlet')
22
 
@@ -158,4 +167,4 @@ def reset_quiz():
158
  participant["score"] = 0
159
 
160
  if __name__ == '__main__':
161
- socketio.run(app, host='0.0.0.0', port=7860, debug=True)
 
10
  import random
11
  import logging
12
 
13
+ # Define a custom filter to ignore logs from a specific IP address
14
+ class IgnoreIPFilter(logging.Filter):
15
+ def filter(self, record):
16
+ # List of IPs you want to ignore in logs
17
+ ignored_ips = ['10.24.22.209']
18
+ if any(ip in record.getMessage() for ip in ignored_ips):
19
+ return False
20
+ return True
21
  # Configure the logging level
22
  logging.getLogger('eventlet.wsgi.server').setLevel(logging.ERROR)
23
 
24
 
25
 
26
  app = Flask(__name__)
27
+ app.logger.addFilter(IgnoreIPFilter())
28
+
29
  app.config['SECRET_KEY'] = 'your_secret_key'
30
  socketio = SocketIO(app, async_mode='eventlet')
31
 
 
167
  participant["score"] = 0
168
 
169
  if __name__ == '__main__':
170
+ socketio.run(app, host='0.0.0.0', port=7860, debug=False)