Skip to content

Commit d5b1daf

Browse files
committed
DISPLAY-1019: Changed logging messages to use placeholders
1 parent 77619af commit d5b1daf

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

src/Feed/KobaFeedType.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ public function getData(Feed $feed): array
6565
try {
6666
$bookings = $this->getBookingsFromResource($kobaHost, $kobaApiKey, $resource, $kobaGroup, $from, $to);
6767
} catch (\Throwable $throwable) {
68-
$this->logger->error('KobaFeedType: Get bookings from resources failed. CODE: '.$throwable->getCode().', MESSAGE: '.$throwable->getMessage());
68+
$this->logger->error('KobaFeedType: Get bookings from resources failed. Code: {code}, Message: {message}', [
69+
'code' => $throwable->getCode(),
70+
'message' => $throwable->getMessage(),
71+
]);
6972
continue;
7073
}
7174

@@ -107,7 +110,10 @@ public function getData(Feed $feed): array
107110

108111
return $results;
109112
} catch (\Throwable $throwable) {
110-
$this->logger->error($throwable->getCode().': '.$throwable->getMessage());
113+
$this->logger->error("{code}: {message}", [
114+
'code' => $throwable->getCode(),
115+
'message' => $throwable->getMessage(),
116+
]);
111117
}
112118

113119
return [];
@@ -206,7 +212,10 @@ public function getConfigOptions(Request $request, FeedSource $feedSource, strin
206212
return $resources;
207213
}
208214
} catch (\Throwable $throwable) {
209-
$this->logger->error($throwable->getCode().': '.$throwable->getMessage());
215+
$this->logger->error("{code}: {message}", [
216+
'code' => $throwable->getCode(),
217+
'message' => $throwable->getMessage(),
218+
]);
210219
}
211220

212221
return null;

src/Feed/SparkleIOFeedType.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ public function getData(Feed $feed): array
6868

6969
return $res;
7070
} catch (\Throwable $throwable) {
71-
$this->logger->error($throwable->getCode().': '.$throwable->getMessage());
71+
$this->logger->error('{code}: {message}', [
72+
'code' => $throwable->getCode(),
73+
'message' => $throwable->getMessage(),
74+
]);
7275
}
7376

7477
return [];
@@ -142,7 +145,10 @@ public function getConfigOptions(Request $request, FeedSource $feedSource, strin
142145
return $feeds;
143146
}
144147
} catch (\Throwable $throwable) {
145-
$this->logger->error($throwable->getCode().': '.$throwable->getMessage());
148+
$this->logger->error('{code}: {message}', [
149+
'code' => $throwable->getCode(),
150+
'message' => $throwable->getMessage(),
151+
]);
146152
}
147153

148154
return null;

0 commit comments

Comments
 (0)