-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Support for CEMENT_FRAMEWORK_LOGGING #639
Comments
Hi @derks It is anoying to see that every time my tests are running. What do you suppose to do best until 3.2? ![]() Thanks for help |
@TomFreudenberg I believe what you want is the following:
The deprecration is triggered if two ways:
If you do want framework logging still, you then would set the environment variable |
class Fairy(App):
"""The Fairy primary application."""
class Meta:
# this app name
label = 'fairy'
framework_logging = False does not work but running tests by: CEMENT_LOG=0 make test prevents the warning from cement but also disables all framework debugs. OK for the moment, but should be improved I suggest. |
@TomFreudenberg ah, yes ... https://github.com/datafolklabs/cement/blob/main/cement/core/foundation.py#L750-L775 # enable framework logging from environment?
if 'CEMENT_LOG' in os.environ.keys():
val = os.environ.get('CEMENT_LOG')
assert val in ['0', '1'], \
f'Invalid value for CEMENT_LOG ({val}). Must be one of: 0, 1'
if is_true(val):
self._meta.framework_logging = True
else:
self._meta.framework_logging = False
if 'CEMENT_FRAMEWORK_LOGGING' in os.environ.keys():
deprecate('3.0.8-1')
val = os.environ.get('CEMENT_FRAMEWORK_LOGGING')
assert val in ['0', '1'], (
f'Invalid value for CEMENT_FRAMEWORK_LOGGING ({val}). Must '
f'be one of: 0, 1'
)
if is_true(val):
self._meta.framework_logging = True
else:
self._meta.framework_logging = False
# DEPRECATE: in v3.2.0, this needs to set os.environ if is True
if self._meta.framework_logging is True:
deprecate('3.0.8-2')
os.environ['CEMENT_LOG_DEPRECATED_DEBUG_OPTION'] = '1' I think we could move the 3.0.8-2 deprecation up first and that might help, but honestly it's probably time to sprint on 3.2.0 and cleanup these outstanding deprecations. |
The env var
CEMENT_FRAMEWORK_LOGGING
was deprecated in favor ofCEMENT_LOG
in Cement 3.0.8. Support needs to be removed in 3.2.0:Deprecation ID:
3.0.8-1
Ref:
The text was updated successfully, but these errors were encountered: