@@ -206,7 +206,9 @@ func (m *Manager) StartWorkspace(ctx context.Context, req *api.StartWorkspaceReq
206
206
clog .Info ("StartWorkspace" )
207
207
reqs , _ := protojson .Marshal (req )
208
208
safeReqs , _ := log .RedactJSON (reqs )
209
- clog .WithField ("req" , string (safeReqs )).Debug ("StartWorkspace request received" )
209
+ safeReqsLog := make (map [string ]interface {})
210
+ _ = json .Unmarshal (safeReqs , & safeReqsLog )
211
+ clog .WithFields (safeReqsLog ).Debug ("StartWorkspace request received" )
210
212
211
213
// Make sure the objects we're about to create do not exist already
212
214
switch req .Type {
@@ -1386,12 +1388,16 @@ func (m *Manager) onChange(ctx context.Context, status *api.WorkspaceStatus) {
1386
1388
if status .Conditions .Failed != "" {
1387
1389
status , _ := protojson .Marshal (status )
1388
1390
safeStatus , _ := log .RedactJSON (status )
1389
- clog .WithField ("status" , string (safeStatus )).Error ("workspace failed" )
1391
+ safeStatusLog := make (map [string ]interface {})
1392
+ _ = json .Unmarshal (safeStatus , & safeStatusLog )
1393
+ clog .WithFields (safeStatusLog ).Error ("workspace failed" )
1390
1394
}
1391
1395
if status .Phase == 0 {
1392
1396
status , _ := protojson .Marshal (status )
1393
1397
safeStatus , _ := log .RedactJSON (status )
1394
- clog .WithField ("status" , string (safeStatus )).Error ("workspace in UNKNOWN phase" )
1398
+ safeStatusLog := make (map [string ]interface {})
1399
+ _ = json .Unmarshal (safeStatus , & safeStatusLog )
1400
+ clog .WithFields (safeStatusLog ).Error ("workspace in UNKNOWN phase" )
1395
1401
}
1396
1402
}
1397
1403
0 commit comments