Needs work
Project:
Cache Router
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2011 at 09:53 UTC
Updated:
25 May 2011 at 15:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
andypostI think it's not a good idea to put core's functions into engines because cacherouter could work before full bootstrap so no DB available and no core modules are loaded... this way to BSOD because module_implements() probably not loaded too...
Comment #2
bpresles commentedWe thought to use watchdog() because we saw that it was already used in connect() function of engines/memcache.php (watchdog('cache', "Unable to connect to memcache server $host:$port", WATCHDOG_ERROR);).
What alternatives would you suggest? error_log()?
Comment #3
andypostI think it's better to introduce a method (debug?) for base class that check for full bootstrap and then uses watchdog()
Comment #4
sdelbosc commentedYou are right.
I checked drupal_bootstrap() code and added watchdog() calls on the different steps. If watchdog() is called too early during the bootstrap, module_implements() is not defined.
I suggest writing a trace() function - with the same signature as watchdog() - which calls error_log() when it is called during bootstrap and watchdog() otherwise.
My problem with this approach is that I think it should be handled by the watchdog() function provided by the core and not by a custom trace() function. Do you share the same opinion?
Comment #5
andypostI think a bit different - trace() is probably a good METHOD of base class but you talk about FUNCTION...
Comment #6
sdelbosc commentedAgain, you are right. If cacherouter module is updated for that, it should be to add a method in the base class and not a function.
However, my thought was that it should be up to watchdog() function of Drupal core to deal with the case where bootstrap is not finished.
Comment #7
atouchard commentedWe add trace() function. This function switch between watchdog() and error_log() (watchdog log format) by bootstrap is finished or not. What do you think ?
Comment #8
andypostGreat! This feature require a bit of settings to be used per cache-bin and reflection in other engines (but this is a different task/issue)
This logging should be disabled by default as it now. Suppose a parameter with FALSE defaults is enough.
This message should contain an $this->name to be usable
Powered by Dreditor.
Comment #9
atouchard commentedAn improved patch :