Skip to content

Commit

Permalink
Add scopes to Object::log() signature.
Browse files Browse the repository at this point in the history
  • Loading branch information
jadb authored and markstory committed Mar 2, 2013
1 parent f1b815a commit 8eb5ce4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Cake/Core/Object.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/ */


App::uses('Set', 'Utility'); App::uses('Set', 'Utility');
App::uses('CakeLog', 'Log');


/** /**
* Object class provides a few generic methods used in several subclasses. * Object class provides a few generic methods used in several subclasses.
Expand Down Expand Up @@ -151,12 +152,12 @@ protected function _stop($status = 0) {
* @param integer $type Error type constant. Defined in app/Config/core.php. * @param integer $type Error type constant. Defined in app/Config/core.php.
* @return boolean Success of log write * @return boolean Success of log write
*/ */
public function log($msg, $type = LOG_ERR) { public function log($msg, $type = LOG_ERR, $scope = null) {
App::uses('CakeLog', 'Log');
if (!is_string($msg)) { if (!is_string($msg)) {
$msg = print_r($msg, true); $msg = print_r($msg, true);
} }
return CakeLog::write($type, $msg);
return CakeLog::write($type, $msg, $scope);
} }


/** /**
Expand Down

0 comments on commit 8eb5ce4

Please sign in to comment.