Skip to content

Commit

Permalink
change default log level to warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
lesstif committed Mar 26, 2015
1 parent a48936d commit 6521f10
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ create config.jira.json file on your project root.
{
"host": "https://your-jira.host.com",
"username": "jira-username",
"password": "jira-password",
"CURLOPT_SSL_VERIFYHOST": false,
"CURLOPT_SSL_VERIFYPEER": false,
"CURLOPT_VERBOSE": false,
"LOG_FILE": "jira-rest-client.log",
"LOG_LEVEL": "WARNING"
"password": "jira-password"
}
````

Expand Down
19 changes: 13 additions & 6 deletions src/JiraClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,21 @@ class JiraClient {
protected $LOG_LEVEL;

private function convertLogLevel($log_level) {
if ($log_level == 'DEBUG')
if ($log_level == 'DEBUG') {
return Logger::DEBUG;
else if ($log_level == 'WARNING')
}
else if ($log_level == 'INFO') {
return Logger::DEBUG;
}
else if ($log_level == 'WARNING') {
return Logger::WARNING;
else if ($log_level == 'ERROR')
}
else if ($log_level == 'ERROR') {
return Logger::ERROR;
else
return Logger::INFO;
}
else {
return Logger::WARNING;
}
}

// serilize only not null field.
Expand Down Expand Up @@ -94,7 +101,7 @@ public function __construct()
$this->CURLOPT_VERBOSE = $config->get('CURLOPT_VERBOSE', false);

$this->LOG_FILE = $config->get('LOG_FILE', 'jira-rest-client.log');
$this->LOG_LEVEL = $this->convertLogLevel($config->get('LOG_LEVEL', Logger::INFO));
$this->LOG_LEVEL = $this->convertLogLevel($config->get('LOG_LEVEL', 'WARNING'));

// create logger
$this->log = new Logger('JiraClient');
Expand Down

0 comments on commit 6521f10

Please sign in to comment.