mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Add scopes to Object::log()
signature.
This commit is contained in:
parent
f1b815a9bb
commit
8eb5ce410a
1 changed files with 4 additions and 3 deletions
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
|
||||
App::uses('Set', 'Utility');
|
||||
App::uses('CakeLog', 'Log');
|
||||
|
||||
/**
|
||||
* Object class provides a few generic methods used in several subclasses.
|
||||
|
@ -151,12 +152,12 @@ class Object {
|
|||
* @param integer $type Error type constant. Defined in app/Config/core.php.
|
||||
* @return boolean Success of log write
|
||||
*/
|
||||
public function log($msg, $type = LOG_ERR) {
|
||||
App::uses('CakeLog', 'Log');
|
||||
public function log($msg, $type = LOG_ERR, $scope = null) {
|
||||
if (!is_string($msg)) {
|
||||
$msg = print_r($msg, true);
|
||||
}
|
||||
return CakeLog::write($type, $msg);
|
||||
|
||||
return CakeLog::write($type, $msg, $scope);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue