Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Remove closing syntax from php files and enforce validation of token …
Browse files Browse the repository at this point in the history
…being present when constructing the logger
  • Loading branch information
MarkLC-r7 committed May 16, 2014
1 parent 54f5e8f commit f72e6fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion LeLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public static function tearDown()

private function __construct($token, $persistent, $use_ssl, $severity)
{
$this->validateToken($token);

$this->_logToken = $token;

$this->persistent = $persistent;
Expand All @@ -94,6 +96,12 @@ public function __destruct()
$this->closeSocket();
}

public function validateToken($token){
if (empty($token)){
throw new InvalidArgumentException('Logentries Token was not provided in logentries.php');
}
}

public function closeSocket()
{
if (is_resource($this->resource)){
Expand Down Expand Up @@ -295,4 +303,3 @@ private function _getTime($level)
}
}
}
?>
1 change: 0 additions & 1 deletion logentries.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@
}

$log = LeLogger::getLogger($LOGENTRIES_TOKEN, $Persistent, $SSL, $Severity);
?>

0 comments on commit f72e6fc

Please sign in to comment.