Because there is no debug level logging for the cache path, it may be difficult to figure out problems associated with setting up DB caching. Also, the check for is dir and is really writable being in the same if statement doesn't really allow for specific debug messages.
Better debugging for DB Cache path
You can bind together:
log_message('debug', 'Cache Path Error: It is not a folder or can not writable. '.$path);
@appleboy, some level of debug logging is better than nothing, but I decided to separate the if statement and have two different debug level log messages because of my experience when I first tested caching. I had never used it before, and when trying to apply the correct path in my config, I had no feedback, and was quite puzzled with the exact reason why debugging wasn't working. Maybe there is a better solution?
Since there are many types of cache, we should prefix these log messages with 'DB' to make it more obvious. Also, while at it - it would probably be better if only the first word in the log message started with a capital letter.
Changes per narfbg