Using both max30102 and mlx90614, but

I think you should replace

#define DEBUG1 1
#define DEBUG2 1

by
#define DEBUG
and use something like this in you code:

#ifdef DEBUG
  .......
#else
 ......
#endif