orf / django-debug-toolbar-template-timings

A django-debug-toolbar panel that displays template rendering times for your Django application
https://pypi.python.org/pypi/django-debug-toolbar-template-timings
MIT License
297 stars 28 forks source link

Respect PRINT_TIMINGS #12

Open maiksprenger opened 11 years ago

maiksprenger commented 11 years ago

As far as I can tell, PRINT_TIMINGS is not actually used anywhere in the code. django-oscar has enabled your (lovely!) panel by default for the sandbox, but I've just realized it trashes my runserver output. I realize I can change my logging settings to suppress it. But either way, PRINT_TIMINGS should either be removed or supported ;)

orf commented 11 years ago

Thanks for this! Yeah, I forgot to remove the PRINT_TIMINGS setting. Are you sure you are using the latest version? I don't see any console output at all from template-timings, I have to explicitly enable it. What logging settings are you using?

maiksprenger commented 11 years ago

You're definitely "printing timings" aka logging in https://github.com/orf/django-debug-toolbar-template-timings/blob/master/template_timings_panel/panels/TemplateTimings.py#L33, and #L115. Those are the ones I see.

The logging settings we use are https://github.com/tangentlabs/django-oscar/blob/master/sites/sandbox/settings.py#L169

I think basically what I want as a feature is a way to suppress log output from your panel. That should be possible with tweaking oscar's logging settings appropriately, so I think there is no more issue. It probably would be nice-to-have to include docs on how to enable/disable logging using Django's logging settings. I might have a look into that, need to disable it for Oscar anyway.

Thanks!

Starefossen commented 9 years ago

For future reference, if anyone wonders how to disable this panel from logging to stdout / console:

'template_timings_panel.panels.TemplateTimings': {
    # Set this to DEBUG to get console output
    'level': 'INFO',
    'handlers': ['console'],
    'propagate': False,
},