Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

Lot of "debugging" errors #55

Open
gusarg81 opened this issue Apr 22, 2019 · 15 comments
Open

Lot of "debugging" errors #55

gusarg81 opened this issue Apr 22, 2019 · 15 comments

Comments

@gusarg81
Copy link

Hi,

Is there a way to remove/disable this errors in terninal when runing python manage.py runserver?:

https://pastebin.com/afqdvXXP

I only added English and Spanish dicts in Tinymce settings ('spellchecker_languages': 'English=en_US,Spanish=es').

Thanks.

@gusarg81 gusarg81 changed the title Lot or "debuggin" errors Lot or "debugging" errors Apr 22, 2019
romanvm added a commit that referenced this issue Apr 27, 2019
This should address #55, because now the spellchecker config is created only
if it's missing from the main TinyMCE config.
@gusarg81 gusarg81 changed the title Lot or "debugging" errors Lot of "debugging" errors Sep 24, 2019
@gusarg81
Copy link
Author

Hi,

This was fixed in 1.7.5? Because I still see all those debug messages. Thanks.

@gusarg81
Copy link
Author

gusarg81 commented Nov 7, 2019

Bump.

EDIT: for now all those info messages disappeared when add LANGUAGES to settings.py, but now there is one only message left to disable:

[2019-11-07 22:11:09,823] widgets: INFO - Enchant languages: ['en', 'en_AU', 'en_CA', 'en_GB', 'en_US', 'es_AR', 'es_ES', 'es_UY', 'es_CU', 'es_VE', 'es_BO', 'es_PE', 'es_CL', 'es_DO', 'es_PA', 'es_NI', 'es_GT', 'es_PY', 'es_PR', 'es_CR', 'es_US', 'es_SV', 'es_CO', 'es_MX', 'es_HN', 'es_EC']

Sorry to ask it again, is there currently a way to set debugging messages?

Thanks.

@merwok
Copy link
Contributor

merwok commented Nov 8, 2019

I don’t know if these are warnings or logging messages, but there are ways to configure both from your app:

@gusarg81
Copy link
Author

gusarg81 commented Nov 8, 2019

Right, but I already have a setup for my Project. At least in my case, is everything is working good with TinyMCE lite, would be good to have an option to disable these logs which comes from TinyMCE Lite.

@merwok
Copy link
Contributor

merwok commented Nov 8, 2019

I am saying that you do have an option!

@gusarg81
Copy link
Author

gusarg81 commented Nov 8, 2019

Yeah, but I don't want to modify what is set for my current Project (unless there is a way to specify Django logs for a certain app). Thanks anyways.

@merwok
Copy link
Contributor

merwok commented Nov 8, 2019

Yes, you can modify logging config for a specific logger.

@romanvm
Copy link
Owner

romanvm commented Nov 8, 2019

The log record in question is created only in debug mode: https://github.com/romanvm/django-tinymce4-lite/blob/master/tinymce/widgets.py#L96 so it shouldn't be logged in production. If you are running Django with debug enabled in production, this is your least issue.

@gusarg81
Copy link
Author

gusarg81 commented Nov 9, 2019

And why you assume that in production I am running it in debug mode? I never mention that, which of course I do not use debug mode in production.
The problem, and very annoying, is to see all those lines mixed with what I really care of my project.

@romanvm
Copy link
Owner

romanvm commented Nov 12, 2019

As you can see in the code, the log record in question is guarded by if settings.DEBUG: condition and should not occur with `DEBUG = False'

@romanvm
Copy link
Owner

romanvm commented Apr 11, 2020

In the latest version the logging logic has been changed and the issue should not happen any more.

@gusarg81
Copy link
Author

Hi,

Fixed in version 1.8.0? Because still:

widgets: DEBUG - Enchant languages: ['es_NI', 'es_BO', 'es_MX', 'es_CR', 'es_GT', 'es_AR', 'es_SV', 'es_PE', 'es_PA', 'es_CL', 'es_DO', 'es_ES', 'es_HN', 'en_US', 'es_UY', 'es_US', 'es_CU', 'es_VE', 'es_EC', 'es_CO', 'es_PY', 'es_PR', 'en', 'en_AU', 'en_CA', 'en_GB']

@romanvm
Copy link
Owner

romanvm commented Apr 15, 2020

Again, I can only recommend to check your project configuration. The message has DEBUG level and should not appear under normal circumstances. E.g. it does not appear in the test project with DEBUG = False.

@georgekpg
Copy link

Hi! I have the same problem - a lot of debugging level log messages in console in any django management command.

The reason of the problem is logging.basicConfig() call in views.py and widgets.py modules.
After I have commented these out, the problem disappeared.

Maybe, the call should not be at module level?

This is what I found and commented out in version 1.8.0:

/myvenv/lib/python3.6/site-packages/tinymce/widgets.py:29:logging.basicConfig(format='[%(asctime)s] %(module)s: %(levelname)s - %(message)s')
/myvenv/lib/python3.6/site-packages/tinymce/views.py:21:logging.basicConfig(format='[%(asctime)s] %(module)s: %(levelname)s - %(message)s')

@gusarg81
Copy link
Author

gusarg81 commented Jun 5, 2020

This is the way finally used to avoid this "non important" debug logs in LOGGING settings (skipped here no necesary settings):

LOGGING = {
...

'handlers': {
...
'tinymce_console': {
'class': 'logging.StreamHandler',
'level': 'INFO'
},
},

'loggers': {
...
'tinymce.widgets': {
'handlers': ['tinymce_console'],
'level': 'INFO',
'propagate': False,
}
}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants