@@ -63,7 +63,12 @@ public function getContent(string $url): string
63
63
64
64
public function log ($ level , $ message , array $ context = [])
65
65
{
66
- $ this ->data [] = $ message ;
66
+ $ replace = [];
67
+ foreach ($ context as $ key => $ val ) {
68
+ $ replace ['{ ' .$ key .'} ' ] = $ val ;
69
+ }
70
+
71
+ $ this ->data [] = strtr ($ message , $ replace );
67
72
}
68
73
69
74
public function getLogs (string $ level = null ): array
@@ -106,8 +111,8 @@ public function contextDataProvider(): array
106
111
'context ' =>[],
107
112
'retval ' => 0 ,
108
113
'log ' => [
109
- '💪 💪 💪 Your Public Suffix List copy is updated. 💪 💪 💪 ' ,
110
- '💪 💪 💪 Your IANA Root Zone Database copy is updated. 💪 💪 💪 ' ,
114
+ 'Public Suffix List Cache updated for 1 DAY using ' .Manager:: PSL_URL ,
115
+ 'IANA Root Zone Database Cache updated for 1 DAY using ' .Manager:: RZD_URL ,
111
116
],
112
117
],
113
118
'refresh psl only ' => [
@@ -116,7 +121,7 @@ public function contextDataProvider(): array
116
121
],
117
122
'retval ' => 0 ,
118
123
'log ' => [
119
- '💪 💪 💪 Your Public Suffix List copy is updated. 💪 💪 💪 ' ,
124
+ 'Public Suffix List Cache updated for 1 DAY using ' .Manager:: PSL_URL ,
120
125
],
121
126
],
122
127
'refresh tld only ' => [
@@ -125,7 +130,7 @@ public function contextDataProvider(): array
125
130
],
126
131
'retval ' => 0 ,
127
132
'log ' => [
128
- '💪 💪 💪 Your IANA Root Zone Database copy is updated. 💪 💪 💪 ' ,
133
+ 'IANA Root Zone Database Cache updated for 1 DAY using ' .Manager:: RZD_URL ,
129
134
],
130
135
],
131
136
'refresh psl fails ' => [
@@ -135,7 +140,7 @@ public function contextDataProvider(): array
135
140
],
136
141
'retval ' => 1 ,
137
142
'log ' => [
138
- 'invalid url: http://localhost/ ' ,
143
+ 'Local cache update failed with invalid url: http://localhost/ ' ,
139
144
],
140
145
],
141
146
];
0 commit comments