1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-02-24 15:02:28 +01:00

Merge remote-tracking branch 'DerManoMann/hipchat_server'

This commit is contained in:
Jordi Boggiano 2014-12-28 16:43:47 +00:00
commit 790d6e7926

View File

@ -71,14 +71,15 @@ class HipChatHandler extends SocketHandler
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
* @param Boolean $useSSL Whether to connect via SSL.
* @param string $format The format of the messages (default to text, can be set to html if you have html in the messages)
* @param string $server The HipChat server name.
*/
public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text')
public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $server = 'api.hipchat.com')
{
if (!$this->validateStringLength($name, static::MAXIMUM_NAME_LENGTH)) {
throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.');
}
$connectionString = $useSSL ? 'ssl://api.hipchat.com:443' : 'api.hipchat.com:80';
$connectionString = $useSSL ? 'ssl://'.$server.':443' : $server.':80';
parent::__construct($connectionString, $level, $bubble);
$this->token = $token;