From af47db79ac479c276707b5b323b16e42dedc875e Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 22 Apr 2014 15:42:17 -0400 Subject: [PATCH] Remove mentions of Object. Remove references to Object and the methods it provides. Fixes #1278 --- en/appendices/3-0-migration-guide.rst | 8 +++++--- en/core-libraries/logging.rst | 4 ++-- en/development/debugging.rst | 14 +++++++------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/en/appendices/3-0-migration-guide.rst b/en/appendices/3-0-migration-guide.rst index b0cd59cbe4..a931161b76 100644 --- a/en/appendices/3-0-migration-guide.rst +++ b/en/appendices/3-0-migration-guide.rst @@ -161,9 +161,11 @@ The config reader classes have been renamed: Object ------ -- ``Object::log()`` was removed from Object and added to the :php:trait:`Cake\\Log\\LogTrait` class. -- ``Object::requestAction()`` was removed from Object and added to the - :php:trait:`Cake\\Routing\\RequestActionTrait`. +The ``Object`` class has been removed. It formerly contained a grab bag of +methods that were used in various places across the framework. The most useful +of these methods have been extracted into traits. You can use the +:php:trait:`Cake\\Log\\LogTrait` to access the ``log()`` method. The +:php:trait:`Cake\\Routing\\RequestActionTrait` provides ``requestAction()``. Console ======= diff --git a/en/core-libraries/logging.rst b/en/core-libraries/logging.rst index 22ce7792db..77632dc0a4 100644 --- a/en/core-libraries/logging.rst +++ b/en/core-libraries/logging.rst @@ -219,10 +219,10 @@ is to use the static :php:meth:`Cake\\Log\\Log::write()` method:: Log::write('debug', 'Something did not work'); The second is to use the log() shortcut function available on any -class that extends ``Object``. Calling log() will internally call +using the ``LogTrait`` Calling log() will internally call ``Log::write()``:: - // Executing this inside a CakePHP class: + // Executing this inside a class using LogTrait $this->log("Something did not work!", 'debug'); All configured log streams are written to sequentially each time diff --git a/en/development/debugging.rst b/en/development/debugging.rst index 20d7f0f0cc..588d78d74c 100644 --- a/en/development/debugging.rst +++ b/en/development/debugging.rst @@ -162,22 +162,22 @@ Using Logging to Debug ====================== Logging messages is another good way to debug applications, and you can use -:php:class:`CakeLog` to do logging in your application. All objects that -extend :php:class:`Object` have an instance method `log()` which can be used +:php:class:`Cake\\Log\\Log` to do logging in your application. All objects that +use ``LogTrait`` have an instance method `log()` which can be used to log messages:: $this->log('Got here', 'debug'); The above would write ``Got here`` into the debug log. You can use log entries to help debug methods that involve redirects or complicated loops. You can also -use :php:meth:`CakeLog::write()` to write log messages. This method can be called +use :php:meth:`Cake\\Log\\Log::write()` to write log messages. This method can be called statically anywhere in your application one CakeLog has been loaded:: - // in app/Config/bootstrap.php - App::uses('CakeLog', 'Log'); + // At the top of the file you want to log in. + use Cake\Log\Log; - // Anywhere in your application - CakeLog::write('debug', 'Got here'); + // Anywhere that Log has been imported. + Log::debug('Got here'); Debug Kit =========