// LogItem logs an item that has been processed
LogItem logs an item that has been processed
// LogItem logs an item that has been processed
func (s RunnerService) LogItem(ctx context.Context, r api.LogItemRequest) (*api.LogResponse, error) {
	logger, err := s.logHandler.Get(r.Runner + "-item.log")
	if err != nil {
		return nil, err
	}
	logger = logger.With(
		zap.String("runner", r.Runner),
		zap.String("stage", r.Stage),
		zap.Int("stage_id", r.StageID),
		zap.Int("count", r.Count),
	)
	if len(r.ProcessStage) > 0 {
		logger = logger.With(zap.String("process_stage", r.ProcessStage))
	}
	if len(r.MimeType) > 0 {
		logger = logger.With(zap.String("mime_type", r.MimeType))
	}
	if len(r.GUID) > 0 {
		logger = logger.With(zap.String("guid", r.GUID))
	}
	var flags []string
	if r.IsCorrupted {
		flags = append(flags, "CORRUPTED")
	}
	if r.IsDeleted {
		flags = append(flags, "DELETED")
	}
	if r.IsEncrypted {
		flags = append(flags, "ENCRYPTED")
	}
	if len(flags) > 0 {
		logger = logger.With(zap.Strings("flags", flags))
	}
	logger.Debug(r.Message)
	return &api.LogResponse{}, nil
}
func ( s RunnerService ) LogItem ( ctx context . Context , r api . LogItemRequest ) ( * api . LogResponse , error ) { logger , err := s . logHandler . Get ( r . Runner + " " ) if err != nil { return nil , err } logger = logger . With ( zap . String ( " " , r . Runner ) , zap . String ( " " , r . Stage ) , zap . Int ( " " , r . StageID ) , zap . Int ( " " , r . Count ) , ) if len ( r . ProcessStage ) > 0 { logger = logger . With ( zap . String ( " " , r . ProcessStage ) ) } if len ( r . MimeType ) > 0 { logger = logger . With ( zap . String ( " " , r . MimeType ) ) } if len ( r . GUID ) > 0 { logger = logger . With ( zap . String ( " " , r . GUID ) ) } var flags [ ] string if r . IsCorrupted { flags = append ( flags , " " ) } if r . IsDeleted { flags = append ( flags , " " ) } if r . IsEncrypted { flags = append ( flags , " " ) } if len ( flags ) > 0 { logger = logger . With ( zap . Strings ( " " , flags ) ) } logger . Debug ( r . Message ) return & api . LogResponse { } , nil }
LogItem logs an item that has been processed
LogItem logs an item that has been processed