Skip to content

Commit

Permalink
tmp: log findall pet
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Feb 21, 2024
1 parent 8461a57 commit 91d167d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/app/service/pet/pet.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,24 @@ func (s *Service) FindAll(_ context.Context, req *proto.FindAllPetRequest) (res
log.Info().
Str("service", "pet").
Str("module", "repo.FindAll").Interface("pets", pets).Msg("")
log.Info().
Str("service", "pet").
Str("module", "repo.FindAll").Msgf("number: %d", len(pets))

petUtils.FilterPet(&pets, req)
petUtils.PaginatePets(&pets, req.Page, req.PageSize, &metaData)
log.Info().
Str("service", "pet").
Str("module", "filtered pets").Interface("filteredPets", pets).Msg("")
log.Info().
Str("service", "pet").
Str("module", "filtered pets").Msgf("number: %d", len(pets))
petUtils.PaginatePets(&pets, req.Page, req.PageSize, &metaData)
log.Info().
Str("service", "pet").
Str("module", "paginated pets").Interface("paginatedPets", pets).Msg("")
log.Info().
Str("service", "pet").
Str("module", "paginated pets").Msgf("number: %d", len(pets))

for _, pet := range pets {
images, err := s.imageService.FindByPetId(pet.ID.String())
Expand All @@ -119,6 +131,9 @@ func (s *Service) FindAll(_ context.Context, req *proto.FindAllPetRequest) (res
log.Info().
Str("service", "pet").
Str("module", "pet with images").Interface("petWithImages", petWithImages).Msg("")
log.Info().
Str("service", "pet").
Str("module", "pet with images").Msgf("number: %d", len(pets))

if err != nil {
return nil, status.Error(codes.Internal, fmt.Sprintf("error converting raw to dto list: %v", err))
Expand Down

0 comments on commit 91d167d

Please sign in to comment.