@@ -130,26 +130,17 @@ function LogCaptureService.OnMessageError(self: LogCaptureService, source: strin
130
130
table.insert (self .MessageQueue , {
131
131
["message" ] = self :OmitUUIDsFromSource (message ),
132
132
["placeVersion" ] = game .PlaceVersion ,
133
+ ["placeId" ] = game .PlaceId ,
133
134
["serverId" ] = ApiService .JobId ,
134
135
["script" ] = filePath ,
135
136
["trace" ] = trace ,
136
137
["ancestors" ] = ancestors ,
137
138
["breadcrumbs" ] = breadcrumbs ,
138
- ["context" ] = HttpService : JSONEncode ( context )
139
+ ["context" ] = context
139
140
})
140
141
end
141
142
142
143
function LogCaptureService .OnStart (self : LogCaptureService )
143
- ApiService .OnAuthenticated :Connect (function (readyPayload )
144
- for _ , pattern in readyPayload .issues .customFilters do
145
- table.insert (self .RegexFilters .Custom , LuauRegex (pattern , "m" ))
146
- end
147
-
148
- for _ , pattern in readyPayload .issues .presetFilters do
149
- table.insert (self .RegexFilters .Preset , LuauRegex (pattern , "m" ))
150
- end
151
- end )
152
-
153
144
ScriptContext .Error :Connect (function (message : string , trace : string )
154
145
self :OnMessageError (message , trace )
155
146
end )
@@ -170,13 +161,30 @@ function LogCaptureService.OnStart(self: LogCaptureService)
170
161
171
162
ApiService :PostAsync (string.format (ApiPaths .ServerLogBatch , ApiService .ProjectId ), {
172
163
items = self .MessageQueue ,
173
- })
164
+ }):catch (function (error )
165
+ -- todo: requeue errors
166
+
167
+ self .Reporter :Warn (`Failed to send log batch - ` )
168
+ self .Reporter :Warn (error )
169
+ end )
174
170
175
171
self .MessageQueue = {}
176
172
end
177
173
end )
178
174
end
179
175
176
+ function LogCaptureService .OnInit (self : LogCaptureService )
177
+ ApiService .OnAuthenticated :Connect (function (readyPayload )
178
+ for _ , pattern in readyPayload .issues .customFilters do
179
+ table.insert (self .RegexFilters .Custom , LuauRegex (pattern , "m" ))
180
+ end
181
+
182
+ for _ , pattern in readyPayload .issues .presetFilters do
183
+ table.insert (self .RegexFilters .Preset , LuauRegex (pattern , "m" ))
184
+ end
185
+ end )
186
+ end
187
+
180
188
export type LogCaptureService = typeof (LogCaptureService )
181
189
182
190
return LogCaptureService
0 commit comments