Yellow eye discharge

My 10 day old has one eye that’s really goopy and today the discharge is quite yellow. When should I worry about infection?