1313 This is handy to quickly look for environment variables.
1414"""
1515
16- from __future__ import print_function , absolute_import , division
17-
1816import importlib
1917import os
2018import textwrap
@@ -116,7 +114,7 @@ def validate_anything(value):
116114
117115convert_str_value_as_is = validate_anything
118116
119- class Setting (object ):
117+ class Setting (metaclass = SettingType ):
120118 name = None
121119 value = None
122120 validate = staticmethod (validate_invalid )
@@ -155,7 +153,6 @@ def set(self, val):
155153 self .value = self .validate (self ._convert (val ))
156154
157155
158- Setting = SettingType ('Setting' , (Setting ,), dict (Setting .__dict__ ))
159156
160157def make_settings ():
161158 """
@@ -176,7 +173,8 @@ class Config(object):
176173 There is one instance of this object at ``gevent.config``. If you
177174 are going to make changes in code, instead of using the documented
178175 environment variables, you need to make the changes before using
179- any parts of gevent that might need those settings. For example::
176+ any parts of gevent that might need those settings (unless otherwise
177+ documented). For example::
180178
181179 >>> from gevent import config
182180 >>> config.fileobject = 'thread'
@@ -351,6 +349,7 @@ class Threadpool(ImportableSetting, Setting):
351349
352350 default = 'gevent.threadpool.ThreadPool'
353351
352+
354353class ThreadpoolIdleTaskTimeout (FloatSettingMixin , Setting ):
355354 document = True
356355 name = 'threadpool_idle_task_timeout'
@@ -546,6 +545,24 @@ class MaxBlockingTime(FloatSettingMixin, Setting):
546545 .. versionadded:: 1.3b1
547546 """
548547
548+
549+ class PrintBlockingReports (BoolSettingMixin , Setting ):
550+ name = 'print_blocking_reports'
551+ default = True
552+
553+ environment_key = 'GEVENT_MONITOR_PRINT_BLOCKING_REPORTS'
554+ desc = """\
555+ If `monitor_thread` is enabled, and gevent detects a hub blocked
556+ for more than `max_blocking_time`, should gevent print a detailed
557+ report about the block?
558+
559+ The report is generated and notifications are broadcast whether
560+ or not the report is printed.
561+
562+ .. versionadded:: NEXT
563+ """
564+
565+
549566class MonitorMemoryPeriod (FloatSettingMixin , Setting ):
550567 name = 'memory_monitor_period'
551568
0 commit comments