|
@@ -14,8 +14,8 @@
|
|
|
namespace Cake\Log;
|
|
namespace Cake\Log;
|
|
|
|
|
|
|
|
use Cake\Core\StaticConfigTrait;
|
|
use Cake\Core\StaticConfigTrait;
|
|
|
-use Cake\Core\Exception\Exception;
|
|
|
|
|
use Cake\Log\Engine\BaseLog;
|
|
use Cake\Log\Engine\BaseLog;
|
|
|
|
|
+use InvalidArgumentException;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Logs messages to configured Log adapters. One or more adapters
|
|
* Logs messages to configured Log adapters. One or more adapters
|
|
@@ -246,7 +246,7 @@ class Log {
|
|
|
* @param string|array $key The name of the logger config, or an array of multiple configs.
|
|
* @param string|array $key The name of the logger config, or an array of multiple configs.
|
|
|
* @param array $config An array of name => config data for adapter.
|
|
* @param array $config An array of name => config data for adapter.
|
|
|
* @return mixed null when adding configuration and an array of configuration data when reading.
|
|
* @return mixed null when adding configuration and an array of configuration data when reading.
|
|
|
- * @throws \Cake\Core\Exception\Exception When trying to modify an existing config.
|
|
|
|
|
|
|
+ * @throws \BadMethodCallException When trying to modify an existing config.
|
|
|
*/
|
|
*/
|
|
|
public static function config($key, $config = null) {
|
|
public static function config($key, $config = null) {
|
|
|
$return = static::_config($key, $config);
|
|
$return = static::_config($key, $config);
|
|
@@ -316,7 +316,7 @@ class Log {
|
|
|
* @param string|array $scope The scope(s) a log message is being created in.
|
|
* @param string|array $scope The scope(s) a log message is being created in.
|
|
|
* See Cake\Log\Log::config() for more information on logging scopes.
|
|
* See Cake\Log\Log::config() for more information on logging scopes.
|
|
|
* @return bool Success
|
|
* @return bool Success
|
|
|
- * @throws \Cake\Core\Exception\Exception If invalid level is passed.
|
|
|
|
|
|
|
+ * @throws \InvalidArgumentException If invalid level is passed.
|
|
|
*/
|
|
*/
|
|
|
public static function write($level, $message, $scope = array()) {
|
|
public static function write($level, $message, $scope = array()) {
|
|
|
static::_init();
|
|
static::_init();
|
|
@@ -325,7 +325,7 @@ class Log {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!in_array($level, static::$_levels)) {
|
|
if (!in_array($level, static::$_levels)) {
|
|
|
- throw new Exception(sprintf('Invalid log level "%s"', $level));
|
|
|
|
|
|
|
+ throw new InvalidArgumentException(sprintf('Invalid log level "%s"', $level));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$logged = false;
|
|
$logged = false;
|