fixing output for logs and accept log level from configs

This commit is contained in:
Ceeram 2011-08-26 09:33:49 +02:00
parent 9e0ff5ad88
commit 9300f094a5

View file

@ -943,7 +943,11 @@ class CakeEmail {
} }
$contents = $this->transportClass()->send($this); $contents = $this->transportClass()->send($this);
if (isset($this->_config['log']) && $this->_config['log']) { if (isset($this->_config['log']) && $this->_config['log']) {
CakeLog::write(LOG_DEBUG, '\nHeaders:\n' . $contents['headers'] . 'Message:\n' . $contents['message']); $level = LOG_DEBUG;
if ($this->_config['log'] !== true) {
$level = $this->_config['log'];
}
CakeLog::write($level, PHP_EOL . $contents['headers'] . PHP_EOL . $contents['message']);
} }
return $contents; return $contents;
} }