Skip to content

Commit 6521f10

Browse files
committed
change default log level to warning.
1 parent a48936d commit 6521f10

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ create config.jira.json file on your project root.
3939
{
4040
"host": "https://your-jira.host.com",
4141
"username": "jira-username",
42-
"password": "jira-password",
43-
"CURLOPT_SSL_VERIFYHOST": false,
44-
"CURLOPT_SSL_VERIFYPEER": false,
45-
"CURLOPT_VERBOSE": false,
46-
"LOG_FILE": "jira-rest-client.log",
47-
"LOG_LEVEL": "WARNING"
42+
"password": "jira-password"
4843
}
4944
````
5045

src/JiraClient.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,21 @@ class JiraClient {
4949
protected $LOG_LEVEL;
5050

5151
private function convertLogLevel($log_level) {
52-
if ($log_level == 'DEBUG')
52+
if ($log_level == 'DEBUG') {
5353
return Logger::DEBUG;
54-
else if ($log_level == 'WARNING')
54+
}
55+
else if ($log_level == 'INFO') {
56+
return Logger::DEBUG;
57+
}
58+
else if ($log_level == 'WARNING') {
5559
return Logger::WARNING;
56-
else if ($log_level == 'ERROR')
60+
}
61+
else if ($log_level == 'ERROR') {
5762
return Logger::ERROR;
58-
else
59-
return Logger::INFO;
63+
}
64+
else {
65+
return Logger::WARNING;
66+
}
6067
}
6168

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

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

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

0 commit comments

Comments
 (0)