Add depth to log().

Much like dump() it is handy to be able to control the depth variables
are dumped out when logged.

Refs #2834
Use simpler assertions.
2.x needs to be compatible with PHP<5.4
Merge pull request #2841 from cakephp/2.5-debugger-log

2.5 debugger log