Add option to enable/disable logging. #3

Closed
wants to merge 1 commit into from
View
4 app/code/community/Aoe/AsyncCache/Model/Cleaner.php
@@ -25,7 +25,9 @@ public function processQueue() {
$startTime = time();
Mage::app()->getCache()->clean($job['mode'], $job['tags'], true);
$job['duration'] = time() - $startTime;
- Mage::log('[ASYNCCACHE] MODE: ' . $job['mode'] . ', DURATION: ' . $job['duration'] . ' sec, TAGS: ' . implode(', ', $job['tags']));
+ if (Mage::getStoreConfigFlag('dev/log/aoeAsyncCacheActive')) {
+ Mage::log('[ASYNCCACHE] MODE: ' . $job['mode'] . ', DURATION: ' . $job['duration'] . ' sec, TAGS: ' . implode(', ', $job['tags']));
+ }
}
// delete all affected asynccache database rows
View
5 app/code/community/Aoe/AsyncCache/etc/config.xml
@@ -107,6 +107,11 @@
<scheduler_cron_expr>*/15 * * * *</scheduler_cron_expr>
</aoeasynccache>
</system>
+ <dev>
+ <log>
+ <aoeAsyncCacheActive>1</aoeAsyncCacheActive>
+ </log>
+ </dev>
</default>
</config>
View
17 app/code/community/Aoe/AsyncCache/etc/system.xml
@@ -34,5 +34,22 @@
</aoeasynccache>
</groups>
</system>
+ <dev>
+ <groups>
+ <log>
+ <fields>
+ <aoeAsyncCacheActive translate="label">
+ <label>Log Aoe_AsyncCache messages</label>
+ <frontend_type>select</frontend_type>
+ <source_model>adminhtml/system_config_source_yesno</source_model>
+ <sort_order>80</sort_order>
+ <show_in_default>1</show_in_default>
+ <show_in_website>1</show_in_website>
+ <show_in_store>1</show_in_store>
+ </aoeAsyncCacheActive>
+ </fields>
+ </log>
+ </groups>
+ </dev>
</sections>
</config>