What are the products in a reaction between a metal and an acid?
Nitric acid ($\ce{HNO3}$) is a strong oxidizing agent. The hydrogen gas ($\ce{H2}$) produced in the reaction with metal is oxidized to $\ce{H2O}$, in turn evolving nitric oxides like $\ce{NO2}$ and $\ce{NO}$. Even magnesium can be observed evolving nitric oxides when reacted with $\ce{HNO3}$.

Additionally, you know that chlorine gas isn't released by the reaction of $\ce{HCl}$ with magnesium because you would see it evolved from the solution as a pale, yellow-green gas. Instead, only clear hydrogen gas is evolved.